Method, apparatus and electronic device for controlling USB device access
The USB device access control method and apparatus verify and monitor USB devices to prevent unauthorized access and data breaches, ensuring data security without additional software installation.
Patent Information
- Application Number
- JP2024532501
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-11-30
- Filing Date
- 2022-11-06
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-11-06
AI Technical Summary
Existing computer systems lack effective security measures to prevent unauthorized access and data breaches through USB devices, particularly due to insider threats and compatibility issues with security software, leading to potential data leaks and system vulnerabilities.
A USB device access control method and apparatus that verifies USB devices by comparing their descriptors with registration information, allowing communication only when descriptors match, and continuously monitoring for changes to ensure data security without installing security software on the protected device.
Ensures data security on protected devices by controlling USB device access, preventing unauthorized communication, and continuously updating descriptor comparisons to maintain protection against potential changes in USB device functionality.
Smart Images

Figure 2024544644000001_ABST
Abstract
Description
[Technical field]
[0001] The present disclosure relates to the field of device access control, and in particular to a method, an apparatus, an electronic device, and a computer-readable recording medium for USB device access control. [Background technology]
[0002] In recent years, computer and network technologies have developed rapidly and networks have become widely used. While people are increasingly enjoying the convenience brought by networks, new threats to the data security of the computers people use in production and daily life have also been brought about, such as the intrusion of general malicious code, virus / Trojan horse infections, DDoS attacks, information theft by hackers, unauthorized access, impersonation of legitimate users, destruction of data integrity, disruption of normal system operation, spread of viruses using networks, and man-in-the-middle attacks.
[0003] At present, there are many technical means to solve the problem of intranet computer network data security, such as installing and using network security products such as black / white lists, traffic control software, firewalls, antivirus, and intrusion detection systems on hosts, but even with the above measures, various network security incidents are still occurring frequently. Statistics show that 70% of computer crimes are caused by illegal use of key resources such as hosts by insiders, and only 30% of the actual threats come from outside. Insiders lack security awareness when using hosts, and are behind firewalls, so access to various external devices is not standardized, and backdoors for viruses or Trojans are embedded, which may lead to data leakage, virus infection, system crashes, and even network paralysis. In addition, system misoperation or intentional destruction may also have a negative impact on institutions, enterprises and business entities, and may even cause serious losses.
[0004] In addition, for some special equipment, such as hosts equipped with special software control, and engineering workstation / operator station equipment in certain industrial fields, due to the special nature of the system, there is no security protection software suitable for such systems on the market, or installing security software is likely to cause compatibility problems with the existing software of the host, which may further affect performance. In addition, after these engineering workstation or operator station hosts are put into production, the operating system is basically not upgraded, and even after security software is installed, the version of anti-malware software and malicious code library are often not updated in a timely manner, which makes it impossible to provide comprehensive security protection.
[0005] The above information disclosed in the Background section is intended solely to facilitate understanding of the background of the present disclosure and may include information that does not constitute prior art already known to those skilled in the art. Summary of the Invention [Problem to be solved by the invention]
[0006] The present disclosure has been made in consideration of the above circumstances, and provides a USB device access control method, device, electronic device, and computer-readable recording medium that can securely protect data of a protected device via a USB access control device that is externally attached to the protected device.
[0007] Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by practice of the present disclosure. [Means for solving the problem]
[0008] According to one aspect of the present disclosure, a method for controlling access to a USB device is proposed, which is applied to a USB access control device connected to a protected device via an interface, and includes the steps of: acquiring a descriptor of the USB device when the USB device is plugged into the USB access control device; comparing the descriptor of the USB device with registration information of the USB device; if the descriptor of the USB device is the same as the registration information of the USB device, closing a switch disposed on the USB access control device so that the USB device can communicate with the protected device; when the USB device communicates with the protected device, continuing to acquire a descriptor of the USB device and comparing the descriptor of the USB device with the registration information of the USB device; and if the descriptor of the USB device is different from the registration information of the USB device, opening a switch disposed on the USB access control device.
[0009] Alternatively, the step of obtaining a descriptor of the USB device includes the steps of sending a Get_Descriptor control packet to the USB device, and receiving a device descriptor determined by the USB device according to the Get_Descriptor control packet.
[0010] Alternatively, the step of comparing the descriptor of the USB device with the registration information of the USB device includes the steps of comparing whether a bDeviceClass in the device descriptor is the same as a bDeviceClass in the registration information, comparing whether a bDeviceSubClass in the device descriptor is the same as a bDeviceSubClass in the registration information, comparing whether a bDeviceProtocol in the device descriptor is the same as a bDeviceProtocol in the registration information, comparing whether a bLength in the device descriptor is the same as a bLength in the registration information, comparing whether a bDescriptorType in the device descriptor is the same as a bDescriptorType in the registration information, and comparing whether a bString in the device descriptor is the same as a bString in the registration information.
[0011] Alternatively, if the descriptor of the USB device is the same as the registration information of the USB device, the step of closing a switch disposed in the USB access control device includes the step of closing a switch disposed in the USB access control device if bDeviceClass, bDeviceSubClass, bDeviceProtocol, bLength, bDescriptorType, and bString in the device descriptor match bDeviceClass, bDeviceSubClass, bDeviceProtocol, bLength, bDescriptorType, and bString in the registration information.
[0012] Alternatively, the step of opening a switch disposed in the USB access control device if the descriptor of the USB device is different from the registration information of the USB device includes the step of opening a switch disposed in the USB access control device if bDeviceClass, bDeviceSubClass, bDeviceProtocol, bLength, bDescriptorType, and bString in the device descriptor are different from any of bDeviceClass, bDeviceSubClass, bDeviceProtocol, bLength, bDescriptorType, and bString in the registration information.
[0013] Alternatively, obtaining a descriptor of the USB device includes sending a Get_Descriptor_Configuration control packet to the USB device, and receiving a configuration descriptor determined by the USB device according to the Get_Descriptor_Configuration control packet.
[0014] Alternatively, the step of comparing the descriptor of the USB device with the registration information of the USB device includes the steps of comparing whether a bNumInterfaces in the configuration descriptor is the same as a bNumInterfaces in the registration information, comparing whether a bConfigurationValue in the configuration descriptor is the same as a bConfigurationValue in the registration information, and comparing whether a wTotalLength in the configuration descriptor is the same as a wTotalLength in the registration information.
[0015] Alternatively, if the descriptor of the USB device is the same as the registration information of the USB device, closing a switch located in the USB access control device includes closing a switch located in the USB access control device if bNumInterfaces, bConfigurationValue, and wTotalLength in the configuration descriptor match bNumInterfaces, bConfigurationValue, and wTotalLengthl in the registration information.
[0016] Alternatively, the step of opening a switch disposed in the USB access control device if the descriptor of the USB device is different from registration information of the USB device includes the step of opening a switch disposed in the USB access control device if bNumInterfaces, bConfigurationValue, and wTotalLength in the configuration descriptor are different from any of bNumInterfaces, bConfigurationValue, and wTotalLength in the registration information.
[0017] Alternatively, the step of obtaining a descriptor of the USB device includes the steps of sending a Get_Descriptor_Configuration control packet to the USB device, and receiving an interface descriptor determined by the USB device according to the Get_Descriptor_Configuration control packet.
[0018] Alternatively, the step of comparing the descriptor of the USB device with the registration information of the USB device includes the steps of: comparing whether the blnterfaceNumber in the interface descriptor is the same as the blnterfaceNumber in the registration information; comparing whether the blnterfaceClass in the interface descriptor is the same as the blnterfaceClass in the registration information; comparing whether the blnterfaceSubClass in the interface descriptor is the same as the blnterfaceSubClass in the registration information; and comparing whether the blnterfaceProtocol in the interface descriptor is the same as the blnterfaceProtocol in the registration information.
[0019] Alternatively, if the descriptor of the USB device is the same as registration information of the USB device, closing a switch disposed in the USB access control device includes closing a switch disposed in the USB access control device if blnterfaceNumber, blnterfaceClass, blnterfaceSubClass, and blnterfaceProtocol in the interface descriptor match blnterfaceNumber, blnterfaceClass, blnterfaceSubClass, and blnterfaceProtocol in the registration information.
[0020] Alternatively, the step of opening a switch disposed in the USB access control device when the descriptor of the USB device is different from registration information of the USB device includes the step of opening a switch disposed in the USB access control device when blnterfaceNumber, blnterfaceClass, blnterfaceSubClass, and blnterfaceProtocol in the interface descriptor are different from any of blnterfaceNumber, blnterfaceClass, blnterfaceSubClass, and blnterfaceProtocol in the registration information.
[0021] Alternatively, the descriptor of the USB device includes a device descriptor, a configuration descriptor, and an interface descriptor, and if the descriptor of the USB device is the same as the registration information of the USB device, closing a switch disposed in the USB access control device includes closing a switch disposed in the USB access control device if the device descriptor, configuration descriptor, and interface descriptor in the descriptor of the USB device match the device descriptor, configuration descriptor, and interface descriptor in the registration information.
[0022] Alternatively, the step of opening a switch disposed in the USB access control device if the descriptor of the USB device is different from the registration information of the USB device includes the step of opening a switch disposed in the USB access control device if a device descriptor, a configuration descriptor, and an interface descriptor in the descriptor of the USB device are different from any of the device descriptor, configuration descriptor, and interface descriptor in the registration information.
[0023] Alternatively, if the USB device is an HID device, the descriptor of the USB device further includes an HID descriptor, and if the descriptor of the USB device is the same as the registration information of the USB device, the step of closing a switch disposed in the USB access control device includes the step of closing a switch disposed in the USB access control device if a device descriptor, a configuration descriptor, an interface descriptor, and a HID descriptor in the descriptor of the USB device match a device descriptor, a configuration descriptor, an interface descriptor, and a HID descriptor in the registration information.
[0024] Alternatively, the step of opening a switch disposed in the USB access control device if the descriptor of the USB device is different from the registration information of the USB device includes the step of opening a switch disposed in the USB access control device if a device descriptor, a configuration descriptor, an interface descriptor, and an HID descriptor in the descriptor of the USB device are different from any of the device descriptor, configuration descriptor, interface descriptor, and HID descriptor in the registration information.
[0025] According to one aspect of the present disclosure, a USB device access control device is proposed, which is applied to a USB access control device connected to a protected device via an interface, the device includes: a first acquisition module for acquiring a descriptor of the USB device when the USB device is plugged into the USB access control device, a comparison module for comparing the descriptor of the USB device with registration information of the USB device, a closing module for closing a switch disposed on the USB access control device when the descriptor of the USB device is the same as the registration information of the USB device so that the USB device and the protected device can communicate with each other, a second acquisition module for continuously acquiring a descriptor of the USB device and comparing the descriptor of the USB device with the registration information of the USB device when the USB device communicates with the protected device, and an opening module for opening a switch disposed on the USB access control device when the descriptor of the USB device is different from the registration information of the USB device.
[0026] According to one aspect of the present disclosure, there is proposed an electronic device comprising one or more processors and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors realize the above-mentioned method.
[0027] According to one aspect of the present disclosure, a computer readable recording medium is proposed storing a computer program, said program implementing the above method when executed by a processor. Effect of the Invention
[0028] According to the method and apparatus for USB device access control, electronic device, and computer-readable recording medium disclosed herein, the method is applied to a USB access control device connected to a protected device via an interface. In this way, data of the protected device can be securely protected through a USB access control device externally attached to the protected device. Data of the protected device can be securely protected without installing security software on the protected device. The USB access control device can determine whether to close a switch disposed in the USB access control device according to a descriptor of the USB device. If the descriptor of the USB device is the same as the registration information of the USB device, the switch disposed in the USB access control device is closed so that the USB device and the protected device can communicate with each other. At this time, the descriptor of the USB device has been successfully verified, but in order to strengthen the protection of the protected device, it is necessary to continue acquiring the descriptor of the USB device and compare the descriptor of the USB device with the registration information of the USB device in real time. This further ensures the data security of the protected device.
[0029] It is to be understood that the foregoing general description and the following detailed description are merely exemplary and are not restrictive of the present disclosure.
[0030] The above and other objects, features and advantages of the present disclosure will become more apparent by describing in detail exemplary embodiments with reference to the drawings. The drawings depicted below are merely some embodiments of the present disclosure, and those skilled in the art can obtain other drawings based on these drawings without any creative activity. [Brief description of the drawings]
[0031] [Figure 1] FIG. 1 is a schematic block diagram illustrating a USB device access control system according to an exemplary embodiment. [Diagram 2]4 is a flowchart illustrating a USB device access control method according to an exemplary embodiment. [Diagram 3] 1 is a schematic diagram showing a specific arrangement of a USB communication data analysis module in a USB access control device according to an exemplary embodiment; FIG. [Figure 4] 10 is a flowchart illustrating a USB device access control method according to another exemplary embodiment. [Diagram 5] 10 is a flowchart illustrating a USB device access control method according to another exemplary embodiment. [Figure 6] 10 is a flowchart illustrating a USB device access control method according to another exemplary embodiment. [Figure 7] FIG. 2 is a schematic diagram showing the connection relationship between a data transfer module and a USB communication data analysis module T according to an exemplary embodiment. [Figure 8] FIG. 1 is a schematic diagram illustrating a network version of a USB device access control system according to an exemplary embodiment. [Figure 9] FIG. 2 is a schematic diagram of software deployed on administrative workstation A according to an exemplary embodiment. [Figure 10] FIG. 2 is a schematic diagram illustrating the connection relationship between a USB communication data analysis module and a data transfer module in a USB registered device according to an exemplary embodiment. [Figure 11] FIG. 2 is a block diagram of a USB device access control device according to an exemplary embodiment. [Figure 12] FIG. 1 is a block diagram of an electronic device in accordance with an illustrative embodiment. [Figure 13] 1 is a block diagram of a computer-readable storage medium according to an exemplary embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0032] Exemplary embodiments will now be described in detail with reference to the accompanying drawings. However, the exemplary embodiments may be implemented in various forms, and the present disclosure should not be construed as being limited to the examples described herein. On the contrary, the implementation examples are provided to make the technical means of the present disclosure more comprehensive and complete, and to comprehensively convey the technical ideas of the exemplary embodiments to those skilled in the art. The same reference numerals in the accompanying drawings represent the same or similar components, and therefore repeated description of the components will be omitted.
[0033] It should be noted that the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Numerous specific details are described to provide a thorough understanding of the embodiments of the present disclosure. However, one of ordinary skill in the art will recognize that the technical means of the present disclosure may be practiced or other methods, components, devices, steps, etc. may be employed without one or more of the specific details. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid unnecessarily obscuring aspects of the present disclosure.
[0034] Some of the block diagrams shown in the accompanying drawings represent functional entities that do not necessarily correspond to physically separate entities, i.e. these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, in different networks and / or processor and / or microcontroller devices.
[0035] The flowcharts illustrated in the accompanying drawings are merely examples, and do not necessarily include all contents and operations / steps, and do not necessarily need to be performed in the order described. For example, some operations / steps can be separated, and some operations / steps can be merged or partially merged, so that the actual execution order may be changed according to actual circumstances.
[0036] In this specification, the terms first, second, third, etc. may be used to describe various components, but it will be understood that these components should not be limited by these terms. These terms are used to distinguish one component from another. Thus, a first component described below may be referred to as a second component without departing from the teachings of the concept of the present disclosure. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0037] It will be understood by those skilled in the art that the attached drawings are only schematic diagrams of exemplary embodiments, and the modules or flows in the attached drawings are not necessarily required to implement the present disclosure, and therefore are not intended to be used to limit the protection scope of the present disclosure.
[0038] FIG. 1 is a schematic diagram illustrating a USB device access control system according to an exemplary embodiment.
[0039] 1, the USB device access control system 100 includes a USB access control device 110, a USB device 120, and a protected device 130. The USB access control device 110 is provided with two USB ports, a USB port UA1 and a USB port UA2. The number of USB ports can be increased according to actual application scenarios.
[0040] In this embodiment, the USB access control device 110 and the USB device 120 can be connected via a USB port UA1. The USB access control device 110 and the protection target device 130 can be connected via a USB port UA2. The USB access control device 110 can be used to securely protect data in the protection target device 130. For example, when the USB device 120 is inserted into the USB port UA1 of the USB access control device 110, the USB access control device 110 can determine whether to allow the USB device 120 to communicate with the protection target device 130 according to the descriptor of the USB device 120. Specifically, when the descriptor of the USB device 120 is the same as the registration information of the USB device 120, the USB device 120 is allowed to communicate with the protection target device 130. Conversely, when the descriptor of the USB device 120 is different from the registration information of the USB device 120, the USB device 120 is not allowed to communicate with the protection target device 130.
[0041] In this embodiment, the USB access control device 110 may be a security device with a data protection function. The USB device 120 may be an external storage device, an external HID device, etc. For example, the external storage device may be a USB flash drive, a portable storage device, etc. The external HID device may be a mouse, a keyboard, a controller, etc.
[0042] 2 is a flow chart illustrating a USB device access control method according to an exemplary embodiment, which is applied to a USB access control device that interfaces with a protected device.
[0043] As shown in FIG. 2, the USB device access control method may include steps S210 to S250.
[0044] In step S210, if the USB device is plugged into the USB access control device, a descriptor of the USB device is obtained.
[0045] In step S220, the descriptor of the USB device is compared with the registration information of the USB device.
[0046] In step S230, if the descriptor of the USB device is the same as the registration information of the USB device, close the switch disposed in the USB access control device so that the USB device and the protected device can communicate with each other.
[0047] In step S240, when the USB device communicates with the protected device, the USB device's descriptor is continuously obtained, and the USB device's descriptor is compared with the registration information of the USB device.
[0048] In step S250, if the descriptor of the USB device is different from the registration information of the USB device, a switch disposed in the USB access control device is opened.
[0049] This method can securely protect data of a protected device through a USB access control device attached to the protected device, so that data of the protected device can be securely protected even when security software is not installed in the protected device. The USB access control device can determine whether to close a switch disposed in the USB access control device according to a descriptor of the USB device. If the descriptor of the USB device is the same as the registration information of the USB device, the switch disposed in the USB access control device is closed so that the USB device and the protected device can communicate with each other. At this time, the USB device descriptor has been successfully verified, but in order to strengthen the protection of the protected device, it is necessary to continue acquiring the USB device descriptor and compare the USB device descriptor with the registration information of the USB device in real time. This further ensures the data security of the protected device.
[0050] Referring to FIG. 3, the USB access control device 110 may include an interface control module and a system control module. The interface control module has three USB ports, USB port UA1, USB port UA2, and USB port UB. The USB port UA1 and USB port UA2 are external interfaces, and the USB port UB is an internal interface. The external interface UA2 is connected to a corresponding USB port UC of the protected device 130. The external interface UA1 is used for connecting one or more USB devices 120. The system control module has an internal interface, which is a USB port UD. The UD of the system control module is electrically connected to the UB of the interface control module and is used to control the security authentication of the external device connected to the external interface UA1 on the interface control module.
[0051] In this embodiment, two USB communication data analysis modules and two switches are also arranged in the interface control module. As shown in FIG. 3, one end of the USB communication data analysis module is connected to the external interface UA1, the other end is connected to one end of the switch, and the other end of the switch is connected to the internal interface UB. One end of another USB communication data analysis module is connected to the external interface UA1, the other end is connected to one end of the switch, and the other end of the switch is connected to the external interface UA2. In this way, the USB communication data analysis modules are connected in series, bypassing the connection between the external interface of the interface control module and the USB port of the protected device, and directly monitoring the descriptor of the USB device in the connection path in real time, and the USB communication data analysis module is realized based on USB protocol analysis and used to analyze the descriptor of the USB device.
[0052] In this embodiment, when the USB device 120 is plugged into the directly connected external interface UA1 and connected to the USB port UC of the protected device, the plugged USB device 120 is powered on, and according to the USB specification, it enters into a device recognition process, i.e., an enumeration process of the USB device 120. For example, when the USB device 120 is plugged into the external interface UA1 of the USB access control device 110, the switch between the internal interface UB and the external interface UA1 of the USB access control device 110 is closed, at this time, the system control module can control the USB communication data analysis module between them to obtain the descriptor of the USB device 120, and compare the descriptor of the USB device 120 with the registration information of the USB device 120. If the descriptor of the USB device 120 is the same as the registration information of the USB device 120, a switch (e.g., a switch between the external interface UA1 and the external interface UA2) disposed in the USB access control device 110 is closed so that the USB device 120 and the protection target device 130 can communicate with each other, and when the USB device 120 communicates with the protection target device 130, a USB communication data analysis module between the external interface UA1 and the external interface UA2 of the USB access control device 110 needs to keep acquiring the descriptor of the USB device 120 and keep comparing the descriptor of the USB device 120 with the registration information of the USB device 120. If the descriptor of the USB device 120 is different from the registration information of the USB device 120, a switch (e.g., a switch between the external interface UA1 and the external interface UA2) disposed in the USB access control device is opened, and at this time, the USB device 120 and the protection target device 130 cannot communicate with each other, so that the data of the protection target device 130 is safely protected.
[0053] Specifically, after the USB device 120 is plugged into UA1 of the USB access control device 110, it is connected to a corresponding USB port on the protected device 130 via an internal connection of the USB access control device 110, the plugged-in USB device 120 is powered on, and according to the USB specification, it enters into a device recognition process, i.e., the initial enumeration process of the USB device 120. Even after the initial enumeration is successful, the USB communication data analysis module must continue to obtain communication data between the USB device 120 and the protected device 130 in real time. The USB communication data analysis module running on the main control board analyzes the communication data between the USB device 120 and the protected device 130 in real time, extracts descriptors in the enumeration process (e.g., vendor ID, product identifier (PID) and serial number information, number of configurations, identification of the current configuration, number of interfaces supported by the configuration, interface number, interface class, interface subclass, interface protocol, etc.), and compares and collates them with the registered information. If a mismatch is found, the communication between the USB device 120 and the protected device 130 is disconnected and an alarm message is issued.
[0054] In some embodiments of the present invention, the USB device 120 descriptor may include one or more of a device descriptor, a configuration descriptor, an interface descriptor, and an HID descriptor.
[0055] According to the USB protocol specification, one USB device 120 has only one device descriptor, which includes the following Table 1.
[0056] [Table 1]
[0057] According to the USB protocol specification, the USB device 120 can have at least one configuration descriptor, and the last item bNumConfigurations of the above device descriptor limits the number of configuration descriptors, for example, the USB device 120 selects one of the current configurations, and the configuration descriptor information is shown in Table 2, and bConfigurationValue is the identifier of the current configuration.
[0058] [Table 2]
[0059] The above interface descriptor can be used to represent the status of the interface in the current configuration. For example, the single-function USB device 120 has one interface, such as a USB flash drive. The multi-function USB device 120 has multiple interfaces, such as a composite device that combines a mouse and a keyboard, and one interface corresponds to one function. The USB device 120 can have multiple configurations, but only one configuration can be currently selected. When the device type bDeviceClass of the device descriptor is 0, which indicates that the interface descriptor is used to identify a class, the interface class, interface subclass, and interface protocol are used to describe the class to which this function of the USB device 120 belongs.
[0060] FIG. 4 is a flowchart illustrating a USB device access control method according to another exemplary embodiment.
[0061] As shown in FIG. 4, obtaining the descriptor of the USB device in the above step S210 may include step S410 and step S420.
[0062] In step S410, a Get_Descriptor control packet is sent to the USB device.
[0063] In step S420, the USB device receives the determined device descriptor in accordance with the Get_Descriptor control packet.
[0064] The method can request acquisition of the device descriptor of the USB device by sending a USB command (eg, a Get_Descriptor control packet) to the USB device so that the USB access control device 110 can quickly acquire the device descriptor of the USB device.
[0065] 3, when the USB device 120 is plugged into the external interface UA1 of the USB access control device 110, the system control module controls the USB communication data analysis module between the internal interface UB and the external interface UA1 to obtain the device descriptor of the USB device 120, and determines whether to close or open the switch disposed in the USB access control device 110 based on the device descriptor. Specifically, when the USB device 120 is plugged into the external interface UA1 of the USB access control device 110, a Get_Descriptor control packet is sent to the USB device 120 via the USB communication data analysis module between the internal interface UB and the external interface UA1, and the USB device 120 returns a device descriptor to the USB communication data analysis module based on the control packet, such as bDeviceClass, bDeviceSubClass, bDeviceProtocol, bLength, bDescriptorType, and bString in the device descriptor. In this case, the USB communication data analysis module can compare the currently acquired device descriptor with the previously acquired registration information of the USB device 120, and perform the initial enumeration of the USB device 120 in this manner.
[0066] For example, the step of comparing the descriptor of USB device 120 with the registration information of USB device 120 includes the steps of comparing whether the bDeviceClass in the device descriptor is the same as the bDeviceClass in the registration information, comparing whether the bDeviceSubClass in the device descriptor is the same as the bDeviceSubClass in the registration information, comparing whether the bDeviceProtocol in the device descriptor is the same as the bDeviceProtocol in the registration information, comparing whether the bLength in the device descriptor is the same as the bLength in the registration information, comparing whether the bDescriptorType in the device descriptor is the same as the bDescriptorType in the registration information, and comparing whether the bString in the device descriptor is the same as the bString in the registration information.
[0067] In some embodiments of the present invention, if the bDeviceClass, bDeviceSubClass, bDeviceProtocol, bLength, bDescriptorType, and bString in the device descriptor match the bDeviceClass, bDeviceSubClass, bDeviceProtocol, bLength, bDescriptorType, and bString in the registration information, a switch disposed in the USB access control device 110 is closed. For example, a switch between the external interface UA1 and the external interface UA2 in the USB access control device 110 is closed.
[0068] In some embodiments of the present invention, if bDeviceClass, bDeviceSubClass, bDeviceProtocol, bLength, bDescriptorType, and bString in the device descriptor are different from any of bDeviceClass, bDeviceSubClass, bDeviceProtocol, bLength, bDescriptorType, and bString in the registration information, a switch disposed in the USB access control device 110 is opened. For example, a switch between the external interface UA1 and the external interface UA2 in the USB access control device 110 is opened. It should be noted that in this case, if the device descriptor in the descriptor of the USB device 120 and the device descriptor in the registration information are different and the switch itself in the USB access control device 110 is in an open state, it is kept in an open state.
[0069] FIG. 5 is a flowchart illustrating a USB device access control method according to another exemplary embodiment.
[0070] As shown in FIG. 5, obtaining the USB device descriptor in the above step S210 may include step S510 and step S520.
[0071] In step S510, a Get_Descriptor_Configuration control packet is sent to the USB device.
[0072] In step S520, the USB device receives the configuration descriptor determined according to the Get_Descriptor_Configuration control packet.
[0073] The method may include sending a USB command (eg, a Get_Descriptor_Configuration control packet) to a USB device to request acquisition of the configuration descriptor of the USB device, so that the USB access control device 110 can quickly acquire the configuration descriptor of the USB device.
[0074] 3, when the USB device 120 is plugged into the external interface UA1 of the USB access control device 110, the system control module controls the USB communication data analysis module between the internal interface UB and the external interface UA1 to obtain the configuration descriptor of the USB device 120, and determines whether to close or open the switch disposed in the USB access control device 110 based on the configuration descriptor. Specifically, when the USB device 120 is plugged into the external interface UA1 of the USB access control device 110, a Get_Descriptor_Configuration control packet is sent to the USB device 120 via the USB communication data analysis module between the internal interface UB and the external interface UA1, and the USB device 120 returns the configuration descriptor to the USB communication data analysis module based on the control packet, for example, bNumInterfaces, bConfigurationValue, and wTotalLength in the configuration descriptor. In this case, the USB communication data analysis module compares the currently obtained configuration descriptor with the previously obtained registration information of the USB device 120, and can perform the initial enumeration of the USB device 120 in this manner.
[0075] For example, the step of comparing the descriptor of USB device 120 with the registration information of USB device 120 includes the steps of comparing whether the bNumInterfaces in the configuration descriptor is the same as the bNumInterfaces in the registration information, comparing whether the bConfigurationValue in the configuration descriptor is the same as the bConfigurationValue in the registration information, and comparing whether the wTotalLength in the configuration descriptor is the same as the wTotalLength in the registration information.
[0076] In some embodiments of the present invention, if the bNumInterfaces, bConfigurationValue, and wTotalLength in the configuration descriptor match the bNumInterfaces, bConfigurationValue, and wTotalLength in the registration information, a switch disposed in the USB access control device 110 is closed. For example, a switch between the external interface UA1 and the external interface UA2 in the USB access control device 110 is closed.
[0077] In some embodiments of the present invention, if bNumInterfaces, bConfigurationValue, and wTotalLength in the configuration descriptor are different from any of bNumInterfaces, bConfigurationValue, and wTotalLength in the registration information, the switch disposed in the USB access control device 110 is opened. For example, the switch between the external interface UA1 and the external interface UA2 in the USB access control device 110 is opened. It should be noted that in this case, if the configuration descriptor in the descriptor of the USB device 120 and the configuration descriptor in the registration information are different and the switch itself in the USB access control device 110 is in an open state, it is kept in the open state.
[0078] FIG. 6 is a flowchart illustrating a USB device access control method according to another exemplary embodiment.
[0079] As shown, obtaining the USB device descriptor in the above step S210 may include step S610 and step S620.
[0080] In step S610, a Get_Descriptor_Configuration control packet is sent to the USB device.
[0081] In step S620, the USB device receives the interface descriptor determined according to the Get_Descriptor_Configuration control packet.
[0082] The method can request acquisition of the interface descriptor of the USB device by sending a USB command (eg, a Get_Descriptor_Configuration control packet) to the USB device, so that the USB access control device 110 can quickly acquire the interface descriptor of the USB device.
[0083] 3, when the USB device 120 is plugged into the external interface UA1 of the USB access control device 110, the system control module controls the USB communication data analysis module between the internal interface UB and the external interface UA1 to obtain the interface descriptor of the USB device 120, and determines whether to close or open the switch disposed in the USB access control device 110 based on the interface descriptor. Specifically, when the USB device 120 is plugged into the external interface UA1 of the USB access control device 110, a Get_Descriptor_Configuration control packet is sent to the USB device 120 via the USB communication data analysis module between the internal interface UB and the external interface UA1, and the USB device 120 returns an interface descriptor to the USB communication data analysis module based on the control packet, such as blnterfaceNumber, blnterfaceClass, bDeviceSubClass, and bInterfaceProtocol in the interface descriptor. In this case, the USB communication data analysis module can compare the currently acquired interface descriptor with the previously acquired registration information of the USB device 120, and perform the initial enumeration of the USB device 120 in this manner.
[0084] For example, the step of comparing the descriptor of the USB device 120 with the registration information of the USB device 120 includes the steps of comparing whether the blnterfaceNumber in the interface descriptor is the same as the blnterfaceNumber in the registration information, comparing whether the blnterfaceClass in the interface descriptor is the same as the blnterfaceClass in the registration information, comparing whether the blnterfaceSubClass in the interface descriptor is the same as the blnterfaceSubClass in the registration information, and comparing whether the blnterfaceProtocol in the interface descriptor is the same as the blnterfaceProtocol in the registration information.
[0085] In some embodiments of the present invention, if the descriptor of the USB device 120 is the same as the registration information of the USB device 120, closing the switch disposed in the USB access control device 110 includes closing the switch disposed in the USB access control device 110 if the blnterfaceNumber, blnterfaceClass, blnterfaceSubClass, and blnterfaceProtocol in the interface descriptor match the blnterfaceNumber, blnterfaceClass, blnterfaceSubClass, and blnterfaceProtocol in the registration information. For example, closing the switch between the external interface UA1 and the external interface UA2 in the USB access control device 110.
[0086] In some embodiments of the present invention, the step of opening a switch disposed in the USB access control device 110 when the descriptor of the USB device 120 is different from the registration information of the USB device 120 includes the step of opening a switch disposed in the USB access control device 110 when blnterfaceNumber, blnterfaceClass, blnterfaceSubClass, and blnterfaceProtocol in the interface descriptor are different from any of blnterfaceNumber, blnterfaceClass, blnterfaceSubClass, and blnterfaceProtocol in the registration information. For example, opening a switch between the external interface UA1 and the external interface UA2 in the USB access control device 110. It should be noted that in the case where the interface descriptor in the descriptor of the USB device 120 is different from the interface descriptor in the registration information, and the switch itself in the USB access control device 110 is in an open state, the switch is kept in an open state at this time.
[0087] The embodiment of FIG. 4-FIG. 6 illustrates that the descriptor of the USB device can be a device descriptor, or a configuration descriptor, or an interface descriptor. The descriptor of the USB device in the present invention may include a device descriptor, a configuration descriptor, and an interface descriptor. Referring to FIG. 3, when the USB device 120 is plugged into the external interface UA1 of the USB access control device 110, the USB communication data analysis module between the external interface UA1 and the internal interface UB in the USB access control device 110 obtains the device descriptor, the configuration descriptor, and the interface descriptor of the USB device 120. For example, send a USB command to the USB device 120, and the USB device 120 returns the device descriptor, the configuration descriptor, and the interface descriptor according to the corresponding USB command. Then, the USB communication data analysis module compares the device descriptor, the configuration descriptor, and the interface descriptor with the device descriptor, the configuration descriptor, and the interface descriptor in the registration information of the USB device 120, i.e. performs the initial enumeration of the USB device 120. If the device descriptor, configuration descriptor, and interface descriptor in the descriptor of the USB device 120 match the device descriptor, configuration descriptor, and interface descriptor in the registration information, the switch arranged in the USB access control device 110 is closed. For example, the switch between the external interface UA1 and the external interface UA2 in the USB access control device 110 is closed. Conversely, if the device descriptor, configuration descriptor, and interface descriptor in the descriptor of the USB device are different from any of the device descriptor, configuration descriptor, and interface descriptor in the registration information, the switch arranged in the USB access control device 110 is opened. For example, the switch between the external interface UA1 and the external interface UA2 in the USB access control device 110 is opened.Please note that if the device descriptor, configuration descriptor, and interface descriptor in the descriptor of the USB device 120 differ from the device descriptor, configuration descriptor, and interface descriptor in the registration information, and the switch in the USB access control device 110 itself is in the open state, it will be kept in the open state.
[0088] According to the technical solution of the above embodiment, if the USB device 120 is a HID device, i.e., a Human Interface Device (HID), the descriptor of the USB device 120 may include a HID descriptor in addition to the above device descriptor, configuration descriptor, and interface descriptor. If the device descriptor, configuration descriptor, interface descriptor, and HID descriptor in the descriptor of the USB device 120 are consistent with the device descriptor, configuration descriptor, interface descriptor, and HID descriptor in the registration information, the switch disposed in the USB access control device 110 is closed. Conversely, if the device descriptor, configuration descriptor, interface descriptor, and HID descriptor in the descriptor of the USB device 120 are different from any of the device descriptor, configuration descriptor, interface descriptor, and HID descriptor in the registration information, the switch disposed in the USB access control device 110 is opened. Please note that if the device descriptor, configuration descriptor, and interface descriptor in the descriptor of the USB device 120 differ from the device descriptor, configuration descriptor, and interface descriptor in the registration information, and the switch in the USB access control device 110 itself is in the open state, it will be kept in the open state.
[0089] 3, after the initial enumeration of the USB device 120 is successful, the switch between the external interface UA1 and the external interface UA2 in the USB access control device 110 is closed, and at this time, the USB device 120 can communicate with the protected device 130. However, while the USB device 120 is in use, the user may change the function of the USB device 120 through the hidden function of the USB device 120, such as opening a hidden storage area or enabling a storage function, and such an operation may change the descriptor of the USB device 120, which may trigger the re-enumeration of the USB device 120 and prevent the user from opening other functions of the USB device 120 during use. In order to do this, the USB communication data analysis module analyzes the USB communication data between UA1 and UA2 in real time, and if the enumeration information is found again during the use of the USB device 120 after the USB device 120 is successfully authenticated, the communication between UA1 and UA2 is disconnected and an alarm is triggered. For example, after the initial enumeration of the USB device 120 is successful, the switch between the external interface UA1 and the external interface UA2 in the USB access control device 110 is closed, and at this time, the USB device 120 can communicate with the protected device 130. During the communication between the two, the USB communication data analysis module between the external interface UA1 and the external interface UA2 in the USB access control device 110 needs to obtain the descriptor of the USB device 120 in real time. If it is observed that the descriptor of the USB device 120 has been changed, the switch between the external interface UA1 and the external interface UA2 is opened, and the USB device is enumerated again. This can prevent the user from turning on the storage or unauthorized function of the USB device 120 during actual use to avoid data security monitoring, thereby causing data leakage on the protected device 130. The protection of the protected device 130 can be enhanced.
[0090] The USB device access control method provided by the present invention can realize the takeover of each interface of the protected device 130 and ensure that a device using the USB interface or serial port of the protected device 130 can be completed through the external terminal protection device (i.e., the USB access control device 110), so that the purpose of protecting the USB interface or serial port of the protected device 130 can be achieved without installing security software in the protected device 130. For example, when the USB device 120 is used, the USB access control device 110 compares the descriptor information of the USB device 120 with the registration information of the USB device 120, and if the comparison results are different, access to the USB device 120 is prohibited and the use of the USB device 120 is discontinued.
[0091] Referring to FIG. 3, the USB communication data analysis module in the USB access control device 110 can be connected in series between the USB device 120 plugged in by the user and the protected device 130, and between the USB device 120 and the system control module in the USB access control device 110. Referring to FIG. 7, by realizing communication data transfer through the data transfer module, the USB communication data analysis module can bypass between the USB device 120 plugged in by the user and the protected device 130, and the system control module in the USB access control device 110. Between the USB device 120 plugged in by the user and the protected device 130, there is a switch, for example, a program-controlled electronic switch, which can control the connection / disconnection between the USB device 120 plugged in by the user and the protected device 130 by a control program. The USB access control device 110 can be connected to a control center via a network port to realize centralized management, or can operate independently without the control center.
[0092] Referring to FIG. 8, a USB device needs to be registered before it can be used, that is, the device needs to be authenticated. Conventional device authentication only covers the vendor ID (VID), product identifier (PID) and serial number information of a USB device, but because the vendor ID, product identifier (PID) and serial number information can be tampered with, these registrations cannot prevent a user from using a USB device to pass the registration review and modify the firmware information of the USB device to make the vendor ID, product identifier (PID) and serial number of a malicious USB device match the genuine USB registered device information. For the above situation, the registration process in the present invention is to obtain the descriptor information of the USB device, check the access mode of the USB device, and load the corresponding driver. The USB descriptor includes a device descriptor, a configuration descriptor, an interface descriptor, an endpoint descriptor, and a string descriptor, and the HID device also includes three descriptors such as a HID descriptor, a report descriptor, and a physical descriptor.
[0093] Specifically, before a USB device is inserted into a USB access control device D or F, it is necessary to insert the USB device into the USB registration port UA of the USB registration device C and perform registration authentication. The USB registration device C and the management workstation B are connected via a USB port. For example, when a USB device is inserted into the USB registration device C, the USB device's descriptor, i.e., registration information, can be obtained through a USB communication data analysis module in the USB registration device C, and the USB device's descriptor can be verified according to the USB protocol specification. Then, the USB device's descriptor that has been successfully verified is sent to the management workstation B via the USB communication port. The management workstation B can report the USB device's registration information to the management server A via the network, so that the management server A can centrally manage the USB device's registration information. When a USB device is inserted into a USB access control device D or F, it can request the management server A to obtain the USB device's registration information, so that after the USB device is inserted into the USB access control device D or F, the USB device's registration information can be compared with the USB device's descriptor. If they match, the USB device and the protected devices G and E will be able to communicate with each other. Conversely, if they do not match, the USB device and the protected devices G and E may not be able to communicate with each other.
[0094] In an embodiment of the present invention, the registration authentication of a USB device can be realized by a software or hardware method. Fig. 8 shows the realization of the registration authentication of a USB device by a hardware method. For example, the registration authentication of a USB device is realized by cooperation between a USB registration device C and a management workstation B. Fig. 9 shows the realization of the registration authentication of a USB device by software installed in the management workstation B. For example, a user inserts a USB device into a USB port of the management workstation, and the registration authentication of the USB device is realized through a USB device registration module and a USB communication data analysis module in the management workstation B.
[0095] When registering and authenticating a USB device, the registration software or hardware reads information such as the device descriptor, configuration descriptor, and interface descriptor of the USB device, and records the current USB interface descriptor information based on the currently used USB device configuration descriptor. This information includes the vendor ID, product identifier (PID), serial number information, the number of configurations, the identifier of the current configuration, the number of interfaces supported by the configuration descriptor, interface number, interface class, interface subclass, interface protocol, etc., and generates a unique identifier as a genuine USB device mark based on this information.
[0096] If the USB device is a Human Interface Device (HID), in view of the current high number of attacks on HID devices, the registration software or hardware will also collect HID descriptor information of the HID device. According to the USB protocol specification, the type definition of the HID device is included in the interface descriptor, and the USB device descriptor and configuration descriptor do not include information on the HID device.
[0097] Referring to Figures 8 and 10, the USB communication data analysis module can connect between the USB registration port and the USB communication port in a direct connection manner, or can use the data transfer module to realize a bypass connection to the communication line between the USB registration port and the USB communication port.
[0098] It will be understood by those skilled in the art that all or part of the steps for implementing the above-mentioned embodiments can be implemented as a computer program executed by a CPU. When the computer program is executed by the CPU, it performs the above-mentioned functions defined by the above-mentioned method provided by the present disclosure. The program can be stored in a computer-readable recording medium, which can be a read-only memory, a magnetic disk, an optical disk, etc.
[0099] It should be noted that the above-mentioned drawings are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easily understood that the processes shown in the above-mentioned drawings do not indicate or limit the time order of these processes. It is also easily understood that these processes may be performed, for example, synchronously or asynchronously in multiple modules.
[0100] The following are embodiments of the apparatus of the present disclosure, which can be used to implement the method embodiments of the present disclosure. For details not disclosed in the apparatus embodiments of the present disclosure, please refer to the method embodiments of the present disclosure.
[0101] FIG. 11 is a block diagram of a USB device access control device according to another exemplary embodiment.
[0102] As shown in FIG. 11, the USB device access control device 200 includes a first obtaining module 210, a comparing module 220, a closing module 230, a second obtaining module 240, and an opening module 250.
[0103] Specifically, the first obtaining module 210 obtains a descriptor of the USB device when the USB device is plugged into the USB access control device.
[0104] A comparison module 220 compares the USB device's descriptor with the USB device's registration information.
[0105] If the descriptor of the USB device is the same as the registration information of the USB device, the closing module 230 closes a switch disposed in the USB access control device so that the USB device and the protected device can communicate with each other.
[0106] The second acquisition module 240 continues to acquire a descriptor of the USB device when the USB device communicates with the protected appliance, and compares the descriptor of the USB device with the registration information of the USB device.
[0107] The opening module 250 opens a switch located in the USB access control device if the descriptor of the USB device is different from the registration information of the USB device.
[0108] The USB device access control device 200 can securely protect data of a device to be protected through a USB access control device externally attached to the device to be protected. Data of the device to be protected can be securely protected without installing security software in the device to be protected. The USB access control device can determine whether to close a switch disposed in the USB access control device according to a descriptor of the USB device. If the descriptor of the USB device is the same as the registration information of the USB device, the switch disposed in the USB access control device is closed so that the USB device and the device to be protected can communicate with each other. At this time, the descriptor of the USB device has passed the verification, but in order to strengthen the protection of the device to be protected, it is necessary to obtain the descriptor of the USB device and compare the descriptor of the USB device with the registration information of the USB device in real time. This further ensures the data security of the device to be protected.
[0109] According to an embodiment of the present invention, the USB device access control device 200 can be used to implement the USB device access control method described in the above embodiments.
[0110] FIG. 12 is a block diagram of an electronic device in accordance with an exemplary embodiment.
[0111] Hereinafter, an electronic device 300 according to an embodiment of the present disclosure will be described with reference to Fig. 12. The electronic device 300 shown in Fig. 12 is merely an example and does not limit the functions and scope of use of the embodiment of the present disclosure.
[0112] 12, the electronic device 300 is embodied in the form of a general-purpose computing device. The components of the electronic device 300 include, but are not limited to, at least one processing unit 310, at least one storage unit 320, a bus 330 connecting different system components (including the storage unit 320 and the processing unit 310), a display unit 340, etc.
[0113] The storage unit may store program code, which may be executed by the processing device 310 such that the processing device 310 performs steps according to various exemplary embodiments of the present disclosure herein. For example, the processing device 310 may perform the steps illustrated in FIGS. 2-6.
[0114] The storage unit 320 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 3201 and / or a cache memory 3202 , and may also include a read only memory (ROM) 3203 .
[0115] The storage unit 320 may also include a program / utilities 3204 having a set (at least one) of program modules 3205, including, but not limited to, an operating system, one or more application programs, other program modules, and program data. Each of these examples, or some combination thereof, may include the implementation of a network environment.
[0116] Bus 330 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of a variety of bus structures.
[0117] The electronic device 300 may also communicate with one or more external devices 300 (e.g., keyboard, pointing device, Bluetooth device, etc.) to allow a user to communicate with the device that the electronic device 300 interacts with and / or any device (e.g., router, modem, etc.) that allows the electronic device 300 to communicate with one or more other computing devices. This communication may occur through an input / output (I / O) interface 350. The electronic device 300 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) through a network adapter 360. The network adapter 360 may communicate with other modules of the electronic device 300 through a bus 330. Although not shown, it will be apparent that other hardware and / or software modules may be used in conjunction with the electronic device 300, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0118] Through the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be realized by software, or can be realized by a combination of software and necessary hardware. Therefore, as shown in Figure 13, the technical means according to the embodiments of the present disclosure can be embodied in the form of a software product, and the software product can be stored (including some instructions) in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a portable storage device, etc.) or on a network, so that a computing device (which can be a personal computer, a server, or a network device, etc.) executes the above method according to the embodiments of the present disclosure.
[0119] The software product may be used in any combination of one or more readable media. The readable medium may be a readable signal medium or a readable recording medium. The readable recording medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (non-exhaustive list) of readable recording media include an electrical connection having one or more conductors, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0120] The computer-readable recording medium may include a data signal propagated in baseband or as part of a carrier wave, into which computer-readable program code is loaded. Such propagated data signals may take various forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. The readable recording medium may be any readable medium other than a readable recording medium, which may transmit, propagate, or transmit a program for use in or in conjunction with an instruction execution system, apparatus, or device. The program code contained in the readable recording medium may be transmitted by any suitable medium, including, but not limited to, wireless, wire, optical cable, RF, or the like, or any suitable combination thereof.
[0121] Computer program code for carrying out the operations of the present disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as general process-based programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user computing device, as a single independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the context of a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).
[0122] The computer-readable recording medium loads one or more programs, and when the one or more programs are executed by the device, the computer-readable recording medium realizes a function of safely protecting data of the protected device via a USB access control device externally attached to the protected device. Data of the protected device can be safely protected without installing security software in the protected device. The USB access control device can determine whether to close a switch disposed in the USB access control device according to a descriptor of the USB device. If the descriptor of the USB device is the same as the registration information of the USB device, the switch disposed in the USB access control device is closed so that the USB device and the protected device can communicate with each other. At this time, the USB device descriptor has been successfully verified, but in order to strengthen the protection of the protected device, it is necessary to continue acquiring the USB device descriptor and compare the USB device descriptor with the registration information of the USB device in real time. This further ensures the data security of the protected device.
[0123] Those skilled in the art will understand that the above-mentioned modules can be distributed in the device according to the description of the embodiment, or can be appropriately changed in one or more devices that are different from the embodiment. The modules in the above-mentioned embodiment can be integrated into one module or further divided into multiple sub-modules.
[0124] Through the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be realized by software, or by a combination of software and necessary hardware. Therefore, the technical means according to the embodiments of the present disclosure can be embodied in the form of a software product, and the software product can be stored (including some instructions) in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a portable storage device, etc.) or on a network, so that a computing device (which can be a personal computer, a server, or a network device, etc.) executes the method according to the embodiments of the present disclosure.
[0125] While exemplary embodiments of the present disclosure have been specifically shown and described, it is understood that the present disclosure is not limited to the details of construction, arrangement, or implementation set forth herein, but rather, the present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A method for controlling access to a USB device, which is applied to a USB access control device connected to a protected device via an interface, comprising: if the USB device is plugged into the USB access control device, obtaining a descriptor of the USB device; comparing the USB device's descriptor with registration information for the USB device; if the descriptor of the USB device is the same as the registration information of the USB device, closing a switch located in the USB access control device to allow the USB device to communicate with the protected device; continuously acquiring a descriptor of the USB device when the USB device communicates with the protected device, and comparing the descriptor of the USB device with registration information of the USB device; and opening a switch disposed in the USB access control device if the descriptor of the USB device is different from the registration information of the USB device.
2. A method for controlling access to a USB device comprising the steps of:
2. The step of obtaining a descriptor of a USB device includes: sending a Get_Descriptor control packet to the USB device; and receiving, by the USB device, a device descriptor determined according to the Get_Descriptor control packet. The USB device access control method according to claim 1 .
3. The step of comparing the descriptor of the USB device with registration information of the USB device includes: comparing whether the bDeviceClass in the device descriptor is the same as the bDeviceClass in the registration information; comparing whether a bDeviceSubClass in the device descriptor is the same as a bDeviceSubClass in the registration information; comparing whether bDeviceProtocol in the device descriptor is the same as bDeviceProtocol in the registration information; comparing whether the bLength in the device descriptor is the same as the bLength in the registration information; comparing whether the bDescriptorType in the device descriptor is the same as the bDescriptorType in the registration information; comparing the bString in the device descriptor with the bString in the registration information to see if they are the same. The USB device access control method according to claim 2 .
4. If the descriptor of the USB device is the same as the registration information of the USB device, closing a switch disposed in the USB access control device includes: and closing a switch disposed in the USB access control device if the bDeviceClass, bDeviceSubClass, bDeviceProtocol, bLength, bDescriptorType, and bString in the device descriptor match the bDeviceClass, bDeviceSubClass, bDeviceProtocol, bLength, bDescriptorType, and bString in the registration information. The USB device access control method according to claim 3.
5. If the descriptor of the USB device is different from the registration information of the USB device, opening a switch disposed in the USB access control device may include: and opening a switch disposed in the USB access control device if bDeviceClass, bDeviceSubClass, bDeviceProtocol, bLength, bDescriptorType, and bString in the device descriptor are different from any of bDeviceClass, bDeviceSubClass, bDeviceProtocol, bLength, bDescriptorType, and bString in the registration information. The USB device access control method according to claim 3.
6. The step of obtaining a descriptor of a USB device includes: sending a Get_Descriptor_Configuration control packet to the USB device; and receiving, by the USB device, a configuration descriptor determined according to the Get_Descriptor_Configuration control packet. The USB device access control method according to claim 1 .
7. The step of comparing the descriptor of the USB device with registration information of the USB device includes: comparing whether the bNumInterfaces in the configuration descriptor and the bNumInterfaces in the registration information are the same; comparing whether the bConfigurationValue in the configuration descriptor is the same as the bConfigurationValue in the registration information; and comparing whether the wTotalLength in the configuration descriptor and the wTotalLength in the registration information are the same. The USB device access control method according to claim 6.
8. If the descriptor of the USB device is the same as the registration information of the USB device, closing a switch disposed in the USB access control device includes: and closing a switch disposed in the USB access control device if the bNumInterfaces, bConfigurationValue, and wTotalLength in the configuration descriptor match the bNumInterfaces, bConfigurationValue, and wTotalLength in the registration information. The USB device access control method according to claim 7.
9. If the descriptor of the USB device is different from the registration information of the USB device, opening a switch disposed in the USB access control device may include: and opening a switch disposed in the USB access control device if bNumInterfaces, bConfigurationValue, and wTotalLength in the configuration descriptor are different from any of bNumInterfaces, bConfigurationValue, and wTotalLength in the registration information. The USB device access control method according to claim 7.
10. The step of obtaining a descriptor of a USB device includes: sending a Get_Descriptor_Configuration control packet to the USB device; and receiving, by the USB device, an interface descriptor determined according to the Get_Descriptor_Configuration control packet. The USB device access control method according to claim 1 .
11. The step of comparing the descriptor of the USB device with registration information of the USB device includes: comparing whether the blnterfaceNumber in the interface descriptor is the same as the blnterfaceNumber in the registration information; comparing whether the blnterfaceClass in the interface descriptor is the same as the blnterfaceClass in the registration information; comparing whether the blnterfaceSubClass in the interface descriptor is the same as the blnterfaceSubClass in the registration information; and comparing whether the blnterfaceProtocol in the interface descriptor is the same as the blnterfaceProtocol in the registration information. The USB device access control method according to claim 10.
12. If the descriptor of the USB device is the same as the registration information of the USB device, closing a switch disposed in the USB access control device includes: and closing a switch disposed in the USB access control device if the blnterfaceNumber, blnterfaceClass, blnterfaceSubClass, and blnterfaceProtocol in the interface descriptor match the blnterfaceNumber, blnterfaceClass, blnterfaceSubClass, and blnterfaceProtocol in the registration information. The USB device access control method according to claim 11.
13. If the descriptor of the USB device is different from the registration information of the USB device, opening a switch disposed in the USB access control device may include: and opening a switch disposed in the USB access control device if blnterfaceNumber, blnterfaceClass, blnterfaceSubClass, and blnterfaceProtocol in the interface descriptor are different from any of blnterfaceNumber, blnterfaceClass, blnterfaceSubClass, and blnterfaceProtocol in the registration information. The USB device access control method according to claim 11.
14. the USB device descriptors include a device descriptor, a configuration descriptor, and an interface descriptor; If the descriptor of the USB device is the same as the registration information of the USB device, closing a switch disposed in the USB access control device includes: closing a switch disposed in the USB access control device if a device descriptor, a configuration descriptor, and an interface descriptor in the descriptor of the USB device match a device descriptor, a configuration descriptor, and an interface descriptor in the registration information. The USB device access control method according to claim 1 .
15. If the descriptor of the USB device is different from the registration information of the USB device, opening a switch disposed in the USB access control device may include: and opening a switch disposed in the USB access control device if a device descriptor, a configuration descriptor, and an interface descriptor in the descriptor of the USB device are different from any of a device descriptor, a configuration descriptor, and an interface descriptor in the registration information. The USB device access control method according to claim 14.
16. If the USB device is a HID device, the USB device descriptor further includes a HID descriptor; If the descriptor of the USB device is the same as the registration information of the USB device, closing a switch disposed in the USB access control device includes: closing a switch disposed in the USB access control device if a device descriptor, a configuration descriptor, an interface descriptor, and an HID descriptor in the USB device descriptor match a device descriptor, a configuration descriptor, an interface descriptor, and an HID descriptor in the registration information. The USB device access control method according to claim 14.
17. If the descriptor of the USB device is different from the registration information of the USB device, opening a switch disposed in the USB access control device may include: and opening a switch disposed in the USB access control device if a device descriptor, a configuration descriptor, an interface descriptor, and an HID descriptor in the descriptor of the USB device are different from any of a device descriptor, a configuration descriptor, an interface descriptor, and an HID descriptor in the registration information. The USB device access control method according to claim 16.
18. A USB device access control device applied to a USB access control device connected to a protected device via an interface, a first acquisition module for acquiring a descriptor of a USB device when the USB device is plugged into the USB access control device; a comparison module for comparing the descriptor of the USB device with registration information of the USB device; a closing module for closing a switch disposed in the USB access control device so that the USB device and the protected device can communicate with each other if the descriptor of the USB device is the same as the registration information of the USB device; a second acquisition module for continuously acquiring a descriptor of the USB device when the USB device communicates with the protected device, and comparing the descriptor of the USB device with registration information of the USB device; and an opening module that opens a switch disposed in the USB access control device if the descriptor of the USB device is different from the registration information of the USB device.
13. A USB device access control device comprising:
19. one or more processors; and a storage device for storing one or more programs, The one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method according to any one of claims 1 to 17.
1. An electronic device comprising:
20. Storing a computer program, which, when executed by a processor, performs the method according to any one of claims 1 to 17 A computer-readable recording medium comprising:
Citation Information
Patent Citations
Image processor
JP2017030273A
Storage control device and storage control method
JP2019105940A
Mediating communciation of a univeral serial bus device
US20120311207A1
User authentication method, user authentication system, and portable communications terminal
WO2011077512A1
Conversion cable and electronic apparatus
WO2020008823A1
