Data transmission method, device, electronic device and storage medium
By setting up the secure replication proxy server channel and client channel on the proxy server, the problem that the proxy server cannot perform proxying under the secure replication command under the Linux system is solved, data interaction between different subnets is realized, and file transfer is improved. security and compliance.
Patent Information
- Application Number
- CN202210254722.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-15
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-03-15
AI Technical Summary
Under Linux systems, traditional proxy servers cannot perform proxying under the secure copy command, resulting in direct file interaction between different subnets.
By setting up a secure replication proxy server channel and a client channel on the proxy server, it receives and forwards data interaction requests between the client and the resource server, and realizes data transmission based on secure replication commands, including connection request authentication, data detection and sensitivity Information interception.
It expands the application scenarios of the secure copy command line, solves the problem that the client and the resource server cannot interact directly in a specific network environment, realizes data interaction between different subnets, and improves the compliance and compliance of file transfers. Security.
Smart Images

Figure CN115941795B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a data transmission method, device, electronic equipment and storage medium. Background Art
[0002] In some network scenarios, different subnets are not connected, so the two parties cannot interact directly. When the two parties cannot interact directly, a proxy server can be used to transfer files. The proxy server setting is only applicable to graphical tools, not to command line tools in the character interface of the Linux system. The most commonly used file transfer tool in the Linux system is Secure Copy (SCP). Traditional proxy servers cannot act as agents under the native secure copy command.
[0003] Therefore, it is necessary to provide a data transmission method to enable a proxy server to perform data interaction between two parties in different subnets based on a secure copy command. Summary of the invention
[0004] The present invention provides a data transmission method, device, electronic equipment and storage medium, which are used to realize data interaction between two parties in different subnets based on a secure copy command by a proxy server.
[0005] The present invention provides a data transmission method, comprising:
[0006] Receive a connection request sent by a client, and allocate a corresponding secure copy proxy server channel based on the connection request;
[0007] Receiving the secure copy command line parameters sent by the client, and establishing a secure copy proxy client channel based on the secure copy proxy server channel and the secure copy command line parameters;
[0008] Based on the secure copy proxy server channel, first interaction data sent by the client is received, and based on the secure copy proxy client channel, the first interaction data is sent to the resource server, and / or, based on the secure copy proxy client channel, second interaction data sent by the resource server is received, and based on the secure copy proxy server channel, the second interaction data is sent to the client.
[0009] According to the data transmission method provided by the present invention, the receiving of the connection request sent by the client and the allocation of the corresponding secure copy proxy server channel based on the connection request include:
[0010] Receiving a connection request sent by the client, and performing a legitimacy authentication on the connection request based on a third-party authentication interface;
[0011] In the case where the connection request authentication is passed, the secure copy proxy server channel is allocated.
[0012] According to the data transmission method provided by the present invention, the first interactive data sent by the client is received based on the secure copy proxy server channel, and the first interactive data is sent to the resource server based on the secure copy proxy client channel, including:
[0013] Based on the secure copy proxy server channel, receiving the first interactive data;
[0014] Executing a sensitive information detection strategy to detect whether the first interaction data contains sensitive information;
[0015] When it is determined that the first interaction data does not contain sensitive information, the first interaction data is sent to the resource server based on the secure copy proxy client channel.
[0016] According to the data transmission method provided by the present invention, the receiving, based on the secure copy proxy client channel, second interactive data sent by the resource server, and sending the second interactive data to the client based on the secure copy proxy server channel, comprises:
[0017] Based on the secure copy proxy client channel, receiving second interaction data sent by the resource server;
[0018] Executing a sensitive information detection strategy to detect whether the second interaction data contains sensitive information;
[0019] When it is determined that the second interaction data does not contain sensitive information, the second interaction data is sent to the client.
[0020] According to the data transmission method provided by the present invention, the execution of the sensitive information detection strategy includes:
[0021] Acquire interaction data, where the interaction data is first interaction data or second interaction data;
[0022] Based on a preset file type identification strategy, determine the file type of the interactive data, and judge whether the file type is a target regulatory file;
[0023] In the case where the file type is a target regulatory file, determining the number of sensitive words in the interactive data based on a preset sensitive field detection strategy;
[0024] When the number of sensitive words is greater than a preset maximum number threshold, the interaction data is determined to be a sensitive file.
[0025] The data transmission method provided by the present invention further includes:
[0026] Before receiving a connection request sent by a client, a monitoring method in a libssh library is bound to monitor whether the client sends a connection request based on the monitoring method in the libssh library.
[0027] According to the data transmission method provided by the present invention, the data transmission method is applied to a proxy server, and the secure copy command line parameters include: proxy server address information and proxy server port information, and resource server address and resource server port information.
[0028] The present invention also provides a data transmission device, comprising:
[0029] A channel allocation module, used for receiving a connection request sent by a client, and allocating a corresponding secure copy proxy server channel based on the connection request;
[0030] A channel building module, used for receiving the secure copy command line parameters sent by the client, and establishing a secure copy proxy client channel based on the secure copy proxy server channel and the secure copy command line parameters;
[0031] A data interaction module is used to receive first interaction data sent by the client based on the secure copy proxy server channel, and send the first interaction data to the resource server based on the secure copy proxy client channel, and / or receive second interaction data sent by the resource server based on the secure copy proxy client channel, and send the second interaction data to the client based on the secure copy proxy server channel.
[0032] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned data transmission methods is implemented.
[0033] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any of the data transmission methods described above is implemented.
[0034] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned data transmission methods.
[0035] The data transmission method, device, electronic device and storage medium provided by the present invention realize data interaction between the client and the resource server by setting a secure copy proxy server channel and a proxy client channel on the proxy server, assist the client in uploading files to the resource server, or the client in downloading files from the resource server, expand the application scenarios of the secure copy command line, and solve the problem that the client and the resource server cannot directly use the secure copy command to interact in certain specific network environments.
[0036] Therefore, the data transmission method provided by the present invention can enable the proxy server to perform data interaction between two parties in different subnets based on the secure copy command. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 It is one of the flowcharts of the data transmission method provided by the present invention;
[0039] Figure 2 It is an interactive schematic diagram of the data transmission method provided by the present invention;
[0040] Figure 3 This is the second flow chart of the data transmission method provided by the present invention;
[0041] Figure 4 It is a schematic diagram of the interactive process of secure data replication provided by the present invention;
[0042] Figure 5 is a flow chart of executing the sensitive information detection strategy provided by the present invention;
[0043] Figure 6 It is a structural schematic diagram of the data transmission device provided by the present invention;
[0044] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] Combine the following Figure 1-Figure 7 The data transmission method, device, electronic device and storage medium of the present invention are described.
[0047] like Figure 1 As shown, the present invention provides a data transmission method, the data transmission method comprising:
[0048] Step 110: Receive a connection request sent by the client, and allocate a corresponding secure copy (SCP) proxy server channel based on the connection request.
[0049] It can be understood that the data transmission method provided by the present invention is applied to a proxy server to assist the client end in performing file data interaction with the resource server.
[0050] The connection request sent by the client is secondary developed based on the source code of libssh (a C language development kit for accessing the SSH service) and redefines the secure copy command line parameters.
[0051] For example, the "username" field format is expanded to "username-target server ip-target server port", the "@target server ip" field meaning is redefined as "@proxy service ip", and the "-Ptarget server port" field meaning is redefined as "-Pproxy service port".
[0052] Modified secure copy command format:
[0053] Upload file: securely copy local file "username-target server IP-target server port"@proxy service IP: remote path-P proxy service port.
[0054] Download file: Secure copy "username-target server IP-target server port"@proxy service IP: remote file-P proxy service port local path.
[0055] Step 120: Receive the secure copy command line parameters sent by the client, and establish a secure copy proxy client channel based on the secure copy proxy server channel and the secure copy command line parameters.
[0056] It is understandable that before establishing the secure copy proxy client channel, it is necessary to initialize the basic information of the secure copy proxy server, initialize the working environment of the libssh library and the loading of sensitive policies, and complete the address binding and service port monitoring.
[0057] Step 130: Based on the secure copy proxy server channel, first interaction data sent by the client is received, and based on the secure copy proxy client channel, the first interaction data is sent to the resource server, and / or, based on the secure copy proxy client channel, second interaction data sent by the resource server is received, and based on the secure copy proxy server channel, the second interaction data is sent to the client.
[0058] It is understandable that the first interactive data may be file data to be uploaded or a download request. The second interactive data may be resource data returned by the resource server based on the download request or resource data actively sent to the client. Both the first interactive data and the second interactive data must comply with the specific format of secure copying.
[0059] In some embodiments, the receiving a connection request sent by a client and allocating a corresponding secure copy proxy server channel based on the connection request includes:
[0060] Receiving a connection request sent by the client, and performing a legitimacy authentication on the connection request based on a third-party authentication interface;
[0061] In the case where the connection request authentication is passed, the secure copy proxy server channel is allocated.
[0062] It is understandable that when a client initiates a connection request, a third-party authentication interface is called to authenticate the legitimacy of the corresponding user account of the client. If the authentication fails, it is directly rejected and the user is prompted, that is, a rejection message is sent to the client.
[0063] If the authentication is successful, the server channel of the secure copy proxy server is allocated, and the m_oScpService object is maintained for information interaction with the client server.
[0064] The secure copy server channel identifies the secure copy command line parameters and parses the related core parameters, completes the establishment of the secure copy client channel based on the obtained core parameters, and maintains the m_oScpClient channel for information interaction with the target resource server. From then on, the secure copy proxy server's sending and receiving channels are established.
[0065] In some embodiments, the receiving, based on the secure copy proxy server channel, first interactive data sent by the client, and sending the first interactive data to the resource server based on the secure copy proxy client channel includes:
[0066] Based on the secure copy proxy server channel, receiving the first interactive data;
[0067] Executing a sensitive information detection strategy to detect whether the first interaction data contains sensitive information;
[0068] When it is determined that the first interaction data does not contain sensitive information, the first interaction data is sent to the resource server based on the secure copy proxy client channel.
[0069] It can be understood that, based on the secure copy proxy server channel, the ssh_channel_poll interface of the libssh library is called to receive the first interaction data.
[0070] The sensitive information detection strategy is called to detect whether there is sensitive field information in the first interaction data uploaded by the client. When it is detected that there is sensitive field information in the first interaction data uploaded by the client, it is blocked and the process ends. Otherwise, the first interaction data is transparently transmitted to the secure copy proxy client channel.
[0071] The secure copy proxy client channel sends the first interactive data to the resource server through the ssh_channel_write interface under the libssh library.
[0072] The resource server processes the first interactive data, and when the first interactive data is a download request, returns the corresponding resource data to the secure copy proxy client channel of the secure copy proxy server.
[0073] In some embodiments, the receiving, based on the secure copy proxy client channel, second interactive data sent by the resource server, and sending the second interactive data to the client based on the secure copy proxy server channel includes:
[0074] Based on the secure copy proxy client channel, receiving second interaction data sent by the resource server;
[0075] Executing a sensitive information detection strategy to detect whether the second interaction data contains sensitive information;
[0076] When it is determined that the second interaction data does not contain sensitive information, the second interaction data is sent to the client.
[0077] It can be understood that after the secure copy proxy client channel receives the second interaction data, i.e., the resource data, returned by the resource server through the ssh_channel_poll interface under the libssh library, the sensitive information detection strategy is called to detect whether there is sensitive field information in the returned second interaction data. When it is detected that there is sensitive field information in the returned second interaction data, the data is blocked and the process ends. Otherwise, the second interaction data is transparently transmitted to the secure copy proxy server channel.
[0078] The secure copy proxy server channel sends the second interactive data to the client through the ssh_channel_write interface under the libssh library.
[0079] In some embodiments, executing the sensitive information detection strategy includes:
[0080] Acquire interaction data, where the interaction data is first interaction data or second interaction data;
[0081] Based on a preset file type identification strategy, determine the file type of the interactive data, and judge whether the file type is a target regulatory file;
[0082] In the case where the file type is a target regulatory file, determining the number of sensitive words in the interactive data based on a preset sensitive field detection strategy;
[0083] When the number of sensitive words is greater than a preset maximum number threshold, the interaction data is determined to be a sensitive file.
[0084] It can be understood that the interaction data may be the first interaction data mentioned above, or may be the second interaction data.
[0085] Before executing the sensitive information detection strategy, the sensitive strategy is loaded first. The sensitive strategy includes the file type identification strategy, the sensitive field detection strategy (ie, the sensitive field list and hit rules), and the maximum number of times the sensitive field is allowed to appear.
[0086] After intercepting the interactive data, the file type of the interactive data is analyzed according to the flow characteristics, and combined with the file type identification strategy, it is determined whether the file type is the target supervision file.
[0087] If the file type is a target regulatory file, the file content is parsed according to the file type characteristics, and the sensitive field detection strategy is called to accumulate the number of times each sensitive field appears and combine the maximum number of times allowed for each sensitive field. That is, based on the preset maximum number threshold, it is determined whether the interactive data is a sensitive file.
[0088] When the number of times a sensitive field appears in the interactive data exceeds the maximum number of times the sensitive field is allowed to appear, the interactive data is determined to be sensitive and is blocked in real time, otherwise it is released.
[0089] In some embodiments, the data transmission method further includes:
[0090] Before receiving a connection request sent by a client, a monitoring method in a libssh library is bound to monitor whether the client sends a connection request based on the monitoring method in the libssh library.
[0091] It can be understood that the initialization of libssh is completed by calling the ssh_bind_new() method in the libssh library, and the binding listening action between the server and the port is completed by executing the ssh_bind_listen() method.
[0092] In some embodiments, the data transmission method is applied to a proxy server, and the secure copy command line parameters include: proxy server address information and proxy server port information, as well as resource server address and resource server port information.
[0093] It is understandable that, since the original safe copy command line parameters themselves do not support setting a proxy server, it is not possible to directly use the safe copy command line parameters to access the target resource server and implement file upload and download operations. Therefore, it is necessary to modify the safe copy command line parameters. The original safe copy command line parameters do not contain the address information and port information of the proxy server. After modifying the original safe copy command line parameters, the corresponding address information and port information of the proxy server are added so that the client can access the target resource server through the proxy server.
[0094] In some other embodiments, the interaction diagram corresponding to the data transmission method is as follows: Figure 2 As shown, the first interactive data sent by the client may be an upload or download command. After receiving the upload or download command, the secure copy proxy server channel transparently transmits the upload or download command to the secure copy proxy client channel. The secure copy proxy client channel sends the upload or download command to the resource server. The resource server returns a response to the secure copy proxy client channel. The response is also the second interactive data. The secure copy proxy client channel transparently transmits the response to the secure copy proxy server channel. The secure copy proxy server channel returns the response to the client.
[0095] Further, the flowchart of the data transmission method is as follows Figure 3As shown, the configuration information of the proxy server is initialized first, and then the initialization of the libssh library working environment is completed by calling ssh_init(), the preset sensitive policy is loaded, the object is created by calling ssh_bind_new(), and the binding listening action of the server address and port is completed by executing ssh_bind_listen(), and ssh_bind_accept() is called to wait for new connection requests in real time. When it is determined that a new connection request has been received, an authentication authorization request is initiated to the authentication server, that is, a third-party authentication request interface is called for secondary authentication. After the authorization is passed, the proxy server channel is allocated and assigned to the object m_oScpServer, the secure copy command line parameters are identified, the user name is parsed, the resource server address and port are obtained, the proxy client channel is allocated, and the object m_oScpClient is assigned, and the data interaction between the secure copy proxy service and the client is processed through m_oScpServer, and the data interaction between the secure copy proxy service and the target server is processed based on m_oScpClient.
[0096] The secure replication data interaction process is as follows Figure 4 As shown, the proxy server channel object m_oScpServer receives the client's request data in real time. When it is determined that there is an uploaded file data stream, it starts to execute the sensitive information detection strategy. When there is sensitive information in the file data stream, the file data stream is blocked. When there is no sensitive information in the file data stream, the received file data stream is forwarded to the proxy client channel object m_oScpClient through m_oScpServer, and the file data stream is forwarded to the resource server through the object m_oScpClient, and the resource data returned by the resource server is received. Then the sensitive information detection strategy is executed on the resource data. If there is sensitive information in the resource data, it is blocked, otherwise the data is returned to the client.
[0097] The flowchart for executing the sensitive information detection strategy is as follows: Figure 5 As shown, when executing the sensitive information detection strategy, first load the file type identification strategy, the sensitive field list, the regular expression for sensitive field identification, and the maximum number of times the sensitive field is allowed to appear, obtain the data to be detected, identify the file type based on the file type identification strategy, and parse the data to be detected according to the file type. If the data to be detected meets the preset file type, it is determined that the data to be detected is not sensitive. If the data to be detected does not meet the preset file type, call the sensitive field regular expression to match whether it hits, accumulate the number of sensitive fields such as ID card, mobile phone number, name, etc., and if the number of hits for each sensitive field in the data to be detected exceeds the maximum number threshold, it is determined that the data to be detected is sensitive. Otherwise, the data to be detected is not sensitive.
[0098] In summary, the data transmission method provided by the present invention includes: receiving a connection request sent by a client, and allocating a corresponding secure copy proxy server channel based on the connection request;
[0099] Receiving the secure copy command line parameters sent by the client, and establishing a secure copy proxy client channel based on the secure copy proxy server channel and the secure copy command line parameters;
[0100] Based on the secure copy proxy server channel, first interaction data sent by the client is received, and based on the secure copy proxy client channel, the first interaction data is sent to the resource server, and / or, based on the secure copy proxy client channel, second interaction data sent by the resource server is received, and based on the secure copy proxy server channel, the second interaction data is sent to the client.
[0101] In the data transmission method provided by the present invention, by setting a secure copy proxy server channel and a proxy client channel on the proxy server side, data interaction between the client and the resource server is realized, and the client is assisted in uploading files to the resource server, or the client downloads files from the resource server, thereby expanding the application scenarios of the secure copy command line and solving the problem that the client and the resource server cannot directly use the secure copy command to interact in certain specific network environments.
[0102] Therefore, the data transmission method provided by the present invention can enable the proxy server to perform data interaction between two parties in different subnets based on the secure copy command.
[0103] Furthermore, the present invention can also expand the secure copy command to support connection to a third-party authentication service for access control, and can automatically intercept and block according to the sensitive content of the interactive data, greatly improving the compliance of file downloading and the security of information.
[0104] The data transmission device provided by the present invention is described below. The data transmission device described below and the data transmission method described above can be referenced to each other.
[0105] like Figure 6 As shown, the data transmission device provided by the present invention includes: a channel allocation module, a channel construction module and a data interaction module.
[0106] The channel allocation module is used to receive a connection request sent by a client, and allocate a corresponding secure copy proxy server channel based on the connection request.
[0107] The channel building module is used to receive the secure copy command line parameters sent by the client, and to establish a secure copy proxy client channel based on the secure copy proxy server channel and the secure copy command line parameters.
[0108] The data interaction module is used to receive first interaction data sent by the client based on the secure copy proxy server channel, and send the first interaction data to the resource server based on the secure copy proxy client channel, and / or receive second interaction data sent by the resource server based on the secure copy proxy client channel, and send the second interaction data to the client based on the secure copy proxy server channel.
[0109] In some embodiments, the channel allocation module includes: an authentication unit and an allocation unit.
[0110] The authentication unit is used to receive the connection request sent by the client and perform legitimacy authentication on the connection request based on a third-party authentication interface.
[0111] The allocation unit is used to allocate the secure copy proxy server channel if the connection request authentication is passed.
[0112] In some embodiments, the data interaction module includes: a first receiving unit, a first detecting unit and a first sending unit.
[0113] The first receiving unit is used for receiving the first interactive data based on the secure copy proxy server channel;
[0114] The first detection unit is used to execute a sensitive information detection strategy to detect whether the first interaction data contains sensitive information;
[0115] The first sending unit is used to send the first interaction data to the resource server based on the secure copy proxy client channel when it is determined that the first interaction data does not contain sensitive information.
[0116] In some embodiments, the data interaction module includes: a second receiving module, a second detection module and a second sending module.
[0117] The second receiving module is used for receiving the second interactive data sent by the resource server based on the secure copy proxy client channel;
[0118] The second detection module is used to execute a sensitive information detection strategy to detect whether the second interaction data contains sensitive information;
[0119] The second sending module is used to send the second interaction data to the client when it is determined that the second interaction data does not contain sensitive information.
[0120] In some embodiments, executing the sensitive information detection strategy includes:
[0121] Acquire interaction data, where the interaction data is first interaction data or second interaction data;
[0122] Based on a preset file type identification strategy, determine the file type of the interactive data, and judge whether the file type is a target regulatory file;
[0123] In the case where the file type is a target regulatory file, determining the number of sensitive words in the interactive data based on a preset sensitive field detection strategy;
[0124] When the number of sensitive words is greater than a preset maximum number threshold, the interaction data is determined to be a sensitive file.
[0125] In some embodiments, the data transmission device further includes: a monitoring module.
[0126] The monitoring module is used to bind the monitoring method in the libssh library before receiving the connection request sent by the client, so as to monitor whether the client sends a connection request based on the monitoring method in the libssh library.
[0127] In some embodiments, the data transmission method is applied to a proxy server, and the secure copy command line parameters include: proxy server address information and proxy server port information, as well as resource server address and resource server port information.
[0128] The electronic device, computer program product, and storage medium provided by the present invention are described below. The electronic device, computer program product, and storage medium described below and the data transmission method described above can be referenced to each other.
[0129] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the data transmission method, which includes:
[0130] Receive a connection request sent by a client, and allocate a corresponding secure copy proxy server channel based on the connection request;
[0131] Receiving the secure copy command line parameters sent by the client, and establishing a secure copy proxy client channel based on the secure copy proxy server channel and the secure copy command line parameters;
[0132] Based on the secure copy proxy server channel, first interaction data sent by the client is received, and based on the secure copy proxy client channel, the first interaction data is sent to the resource server, and / or, based on the secure copy proxy client channel, second interaction data sent by the resource server is received, and based on the secure copy proxy server channel, the second interaction data is sent to the client.
[0133] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0134] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the data transmission method provided by the above methods, the method comprising:
[0135] Receive a connection request sent by a client, and allocate a corresponding secure copy proxy server channel based on the connection request;
[0136] Receiving the secure copy command line parameters sent by the client, and establishing a secure copy proxy client channel based on the secure copy proxy server channel and the secure copy command line parameters;
[0137] Based on the secure copy proxy server channel, first interaction data sent by the client is received, and based on the secure copy proxy client channel, the first interaction data is sent to the resource server, and / or, based on the secure copy proxy client channel, second interaction data sent by the resource server is received, and based on the secure copy proxy server channel, the second interaction data is sent to the client.
[0138] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the data transmission method provided by the above methods is implemented, and the method includes:
[0139] Receive a connection request sent by a client, and allocate a corresponding secure copy proxy server channel based on the connection request;
[0140] Receiving the secure copy command line parameters sent by the client, and establishing a secure copy proxy client channel based on the secure copy proxy server channel and the secure copy command line parameters;
[0141] Based on the secure copy proxy server channel, first interaction data sent by the client is received, and based on the secure copy proxy client channel, the first interaction data is sent to the resource server, and / or, based on the secure copy proxy client channel, second interaction data sent by the resource server is received, and based on the secure copy proxy server channel, the second interaction data is sent to the client.
[0142] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0143] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0144] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data transmission method, characterized in that: include: Receive a connection request sent by a client, and allocate a corresponding secure copy proxy server channel based on the connection request; Receiving the secure copy command line parameters sent by the client, and establishing a secure copy proxy client channel based on the secure copy proxy server channel and the secure copy command line parameters; Based on the secure copy proxy server channel, receiving first interaction data sent by the client, and based on the secure copy proxy client channel, sending the first interaction data to the resource server, and / or, based on the secure copy proxy client channel, receiving second interaction data sent by the resource server, and based on the secure copy proxy server channel, sending the second interaction data to the client; The receiving the first interactive data sent by the client based on the secure copy proxy server channel, and sending the first interactive data to the resource server based on the secure copy proxy client channel, comprises: Based on the secure copy proxy server channel, receiving the first interactive data; Executing a sensitive information detection strategy to detect whether the first interaction data contains sensitive information; In the case where it is determined that the first interaction data does not contain sensitive information, sending the first interaction data to the resource server based on the secure copy proxy client channel; The receiving, based on the secure copy proxy client channel, second interactive data sent by the resource server, and sending the second interactive data to the client based on the secure copy proxy server channel, comprises: Based on the secure copy proxy client channel, receiving second interaction data sent by the resource server; Executing a sensitive information detection strategy to detect whether the second interaction data contains sensitive information; If it is determined that the second interaction data does not contain sensitive information, sending the second interaction data to the client; Implement sensitive information detection strategies, including: Acquiring interaction data, where the interaction data is first interaction data or second interaction data; Determining the file type of the interactive data based on a preset file type identification strategy; If the file type meets the preset file type, it is determined that the interactive data is not sensitive; If the file type does not meet the preset file type, the sensitive field regular expression is called to check whether it is matched; If there is a hit, the number of times the sensitive fields of ID card, mobile phone number and name are hit is accumulated respectively. If the number of hits of each sensitive field in the interaction data exceeds the respective maximum number threshold, the interaction data is determined to be sensitive; otherwise, the interaction data is determined to be not sensitive.
2. The data transmission method according to claim 1, characterized in that: The receiving a connection request sent by the client and allocating a corresponding secure copy proxy server channel based on the connection request includes: Receiving a connection request sent by the client, and performing a legitimacy authentication on the connection request based on a third-party authentication interface; In the case where the connection request authentication is passed, the secure copy proxy server channel is allocated.
3. The data transmission method according to claim 1, characterized in that: Also includes: Before receiving a connection request sent by a client, a monitoring method in a libssh library is bound to monitor whether the client sends a connection request based on the monitoring method in the libssh library.
4. The data transmission method according to claim 1, characterized in that: The data transmission method is applied to a proxy server, and the secure copy command line parameters include: proxy server address information and proxy server port information, as well as resource server address and resource server port information.
5. A data transmission device, characterized in that: include: A channel allocation module, used for receiving a connection request sent by a client, and allocating a corresponding secure copy proxy server channel based on the connection request; A channel building module, used for receiving the secure copy command line parameters sent by the client, and establishing a secure copy proxy client channel based on the secure copy proxy server channel and the secure copy command line parameters; A data interaction module, configured to receive first interaction data sent by the client based on the secure copy proxy server channel, and send the first interaction data to the resource server based on the secure copy proxy client channel, and / or receive second interaction data sent by the resource server based on the secure copy proxy client channel, and send the second interaction data to the client based on the secure copy proxy server channel; The receiving the first interactive data sent by the client based on the secure copy proxy server channel, and sending the first interactive data to the resource server based on the secure copy proxy client channel, comprises: Based on the secure copy proxy server channel, receiving the first interactive data; Executing a sensitive information detection strategy to detect whether the first interaction data contains sensitive information; In the case where it is determined that the first interaction data does not contain sensitive information, sending the first interaction data to the resource server based on the secure copy proxy client channel; The receiving, based on the secure copy proxy client channel, second interactive data sent by the resource server, and sending the second interactive data to the client based on the secure copy proxy server channel, comprises: Based on the secure copy proxy client channel, receiving second interaction data sent by the resource server; Executing a sensitive information detection strategy to detect whether the second interaction data contains sensitive information; If it is determined that the second interaction data does not contain sensitive information, sending the second interaction data to the client; Implement sensitive information detection strategies, including: Acquiring interaction data, where the interaction data is first interaction data or second interaction data; Determining the file type of the interactive data based on a preset file type identification strategy; If the file type meets the preset file type, it is determined that the interactive data is not sensitive; If the file type does not meet the preset file type, the sensitive field regular expression is called to check whether it is matched; If there is a hit, the number of times the sensitive fields of ID card, mobile phone number and name are hit is accumulated respectively. If the number of hits of each sensitive field in the interaction data exceeds the respective maximum number threshold, the interaction data is determined to be sensitive; otherwise, the interaction data is determined to be not sensitive.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the data transmission method according to any one of claims 1 to 4 is implemented.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 4 is implemented.
