CN116599716A - Network security protection method, device, equipment and medium - Google Patents
Network security protection method, device, equipment and medium Download PDFInfo
- Publication number
- CN116599716A CN116599716A CN202310530391.7A CN202310530391A CN116599716A CN 116599716 A CN116599716 A CN 116599716A CN 202310530391 A CN202310530391 A CN 202310530391A CN 116599716 A CN116599716 A CN 116599716A
- Authority
- CN
- China
- Prior art keywords
- data packet
- network card
- security
- network
- image data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000012545 processing Methods 0.000 claims description 20
- 230000004044 response Effects 0.000 claims description 12
- 238000007689 inspection Methods 0.000 claims description 8
- 238000004891 communication Methods 0.000 abstract description 17
- 230000006870 function Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 13
- 230000006399 behavior Effects 0.000 description 12
- 239000000243 solution Substances 0.000 description 11
- 230000009471 action Effects 0.000 description 8
- 238000004590 computer program Methods 0.000 description 8
- 238000013519 translation Methods 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 238000004519 manufacturing process Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 4
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 4
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 3
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 3
- 238000002347 injection Methods 0.000 description 3
- 239000007924 injection Substances 0.000 description 3
- 230000002085 persistent effect Effects 0.000 description 3
- 238000003672 processing method Methods 0.000 description 3
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000001934 delay Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 238000005065 mining Methods 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 101100152304 Caenorhabditis elegans tap-1 gene Proteins 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000011217 control strategy Methods 0.000 description 1
- 230000001066 destructive effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 238000010223 real-time analysis Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/14—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
- H04L63/1441—Countermeasures against malicious traffic
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
技术领域Technical Field
本公开实施例涉及计算机技术领域,尤其涉及一种网络安全防护方法、装置、设备及介质。The embodiments of the present disclosure relate to the field of computer technology, and in particular to a network security protection method, device, equipment and medium.
背景技术Background Art
随着信息化技术的不断发展,网络安全变得越来重要。为了对网络安全进行维护,需要对网络流量进行检测。例如,当虚拟机产生挖矿的行为时,云平台需要对整个区域的所有域名系统(Domain Name System,DNS)请求的数据包进行分析,依据域名特征及时地杜绝挖矿行为。又如,云平台的业务网际互连协议(Internet Protocol,IP)、物理机器、虚拟主机等资源需要对网络流量进行安全防护。租户会根据自己的业务特点设置南北向(云内和云外的访问)和东西向(内网之间的访问)的网络防护,东西向即内网的流量往往特别大,某些业务特点对东西向的网络延迟有要求,延迟过高会影响业务的正常工作。With the continuous development of information technology, network security has become increasingly important. In order to maintain network security, network traffic needs to be detected. For example, when a virtual machine generates mining behavior, the cloud platform needs to analyze all the Domain Name System (DNS) request data packets in the entire area and promptly eliminate mining behavior based on the domain name characteristics. For another example, the cloud platform's business Internet Protocol (IP), physical machines, virtual hosts and other resources need to provide security protection for network traffic. Tenants will set up north-south (access within and outside the cloud) and east-west (access between intranets) network protection according to their own business characteristics. The east-west traffic, that is, the intranet traffic, is often particularly large. Some business characteristics have requirements for east-west network delays. Excessive delays will affect the normal operation of the business.
上述两种情况均会产生大流量,当大量的数据包都牵引到网络安全设备进行即时的分析和防护时,有以下缺点:Both of the above situations will generate large traffic. When a large number of data packets are pulled to the network security device for real-time analysis and protection, there are the following disadvantages:
1)由于网络链路变长,加上安全设备的分析也需要一定的时间,将会造成单位数据包通讯时间的延长,造成网络延迟变大。1) As the network link becomes longer and the analysis of security equipment takes a certain amount of time, the communication time per unit data packet will be extended, causing the network delay to increase.
2)大量的数据包牵引到安全设备,云资源到安全设备之间又会产生往返的大流量,增加了网络链路的负载。2) A large number of data packets are pulled to the security devices, which in turn generates a large amount of round-trip traffic between cloud resources and the security devices, increasing the load on the network link.
3)由于“设定行为攻击”是一种持久性的行为,而东西向流量是内网之间的通讯,一般来说外网访问不到内网,内网本身是相对安全的,因此,全流量的即时防护显得过重。其中,设定行为可以理解为是一种作算法运算的过程,从计算机和代码的角度来说,是反复执行哈希函数并检测执行结果的具体过程。设定行为也可以理解为是利用计算机计算资源(或云资源),通过访问设定网址并反复运行算法的过程。3) Since "set behavior attack" is a persistent behavior, and east-west traffic is communication between intranets, generally speaking, the external network cannot access the intranet, and the intranet itself is relatively safe. Therefore, real-time protection of all traffic is too heavy. Among them, set behavior can be understood as a process of performing algorithm calculations. From the perspective of computers and codes, it is a specific process of repeatedly executing hash functions and detecting the execution results. Set behavior can also be understood as the process of using computer computing resources (or cloud resources) to access set URLs and repeatedly run algorithms.
发明内容Summary of the invention
本公开实施例提供一种网络安全防护方法、装置、设备及介质,可以在实现网络安全防护的同时,降低网络链路的负载。The embodiments of the present disclosure provide a network security protection method, apparatus, device and medium, which can reduce the load of a network link while achieving network security protection.
第一方面,本公开实施例提供了一种网络安全防护方法,包括:拷贝第一网卡的数据包,形成镜像数据包;其中,所述第一网卡安装于第一宿主机上;通过第一网卡将所述镜像数据包发送至第二网卡;其中,所述第二网卡安装于第二宿主机上;通过所述第二网卡将所述镜像数据包发送至引流模块;其中,所述引流模块位于第三宿主机上;通过所述引流模块将所述镜像数据包发送至安全设备;基于所述安全设备输出的安全日志对当前网络进行安全防护。In a first aspect, an embodiment of the present disclosure provides a network security protection method, comprising: copying a data packet of a first network card to form a mirror data packet; wherein the first network card is installed on a first host machine; sending the mirror data packet to a second network card through the first network card; wherein the second network card is installed on a second host machine; sending the mirror data packet to a drainage module through the second network card; wherein the drainage module is located on a third host machine; sending the mirror data packet to a security device through the drainage module; and performing security protection on the current network based on a security log output by the security device.
第二方面,本公开实施例还提供了一种网络安全防护装置,包括:数据包拷贝模块,用于拷贝第一网卡的数据包,形成镜像数据包;其中,所述第一网卡安装于第一宿主机上;第一镜像数据包发送模块,用于通过第一网卡将所述镜像数据包发送至第二网卡;其中,所述第二网卡安装于第二宿主机上;第二镜像数据包发送模块,用于通过所述第二网卡将所述镜像数据包发送至引流模块;其中,所述引流模块位于第三宿主机上;第三镜像数据包发送模块,用于通过所述引流模块将所述镜像数据包发送至安全设备;安全防护模块,用于基于所述安全设备输出的安全日志对当前网络进行安全防护。In the second aspect, the embodiment of the present disclosure also provides a network security protection device, including: a data packet copying module, used to copy the data packet of the first network card to form a mirror data packet; wherein the first network card is installed on the first host machine; a first mirror data packet sending module, used to send the mirror data packet to the second network card through the first network card; wherein the second network card is installed on the second host machine; a second mirror data packet sending module, used to send the mirror data packet to the drainage module through the second network card; wherein the drainage module is located on the third host machine; a third mirror data packet sending module, used to send the mirror data packet to the security device through the drainage module; a security protection module, used to perform security protection on the current network based on the security log output by the security device.
第三方面,本公开实施例还提供了一种电子设备,所述电子设备包括:In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
一个或多个处理器;one or more processors;
存储装置,用于存储一个或多个程序,a storage device for storing one or more programs,
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如本公开实施例所述的网络安全防护方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the network security protection method as described in the embodiment of the present disclosure.
第四方面,本公开实施例还提供了一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如本公开实施例所述的网络安全防护方法。In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the network security protection method as described in the embodiment of the present disclosure.
本公开实施例的技术方案,拷贝第一网卡的数据包,形成镜像数据包;其中,所述第一网卡安装于第一宿主机上;通过第一网卡将所述镜像数据包发送至第二网卡;其中,所述第二网卡安装于第二宿主机上;通过所述第二网卡将所述镜像数据包发送至引流模块;其中,所述引流模块位于第三宿主机上;通过所述引流模块将所述镜像数据包发送至安全设备;基于所述安全设备输出的安全日志对当前网络进行安全防护。本公开实施例,通过拷贝经过第一网卡的数据包,形成镜像数据包,将镜像数据包发送至引流模块中,通过引流模块将镜像数据包发送至安全设备,并基于安全设备输出的安全日志对当前网络进行安全防护的方式,可以在实现网络安全防护的同时,降低网络链路的负载,降低数据包通讯的延迟时间。The technical solution of the disclosed embodiment is to copy the data packet of the first network card to form a mirror data packet; wherein the first network card is installed on the first host machine; the mirror data packet is sent to the second network card through the first network card; wherein the second network card is installed on the second host machine; the mirror data packet is sent to the drainage module through the second network card; wherein the drainage module is located on the third host machine; the mirror data packet is sent to the security device through the drainage module; and the current network is protected based on the security log output by the security device. The disclosed embodiment copies the data packet passing through the first network card to form a mirror data packet, sends the mirror data packet to the drainage module, sends the mirror data packet to the security device through the drainage module, and protects the current network based on the security log output by the security device. This can reduce the load of the network link and reduce the delay time of data packet communication while achieving network security protection.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
图1为本公开实施例所提供的一种网络安全防护方法流程示意图;FIG1 is a schematic diagram of a network security protection method provided by an embodiment of the present disclosure;
图2为本发明实施例提供的一种网络安全防护效果示意图;FIG2 is a schematic diagram of a network security protection effect provided by an embodiment of the present invention;
图3为本公开实施例所提供的一种网络安全防护装置结构示意图;FIG3 is a schematic diagram of the structure of a network security protection device provided by an embodiment of the present disclosure;
图4为本公开实施例所提供的一种电子设备的结构示意图。FIG. 4 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure.
具体实施方式DETAILED DESCRIPTION
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and/or in parallel. In addition, the method embodiments may include additional steps and/or omit the steps shown. The scope of the present disclosure is not limited in this respect.
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。可以理解的是,本技术方案所涉及的数据(包括但不限于数据本身、数据的获取或使用)应当遵循相应法律法规及相关规定的要求。The term "including" and its variations used in this article are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
图1为本公开实施例所提供的一种网络安全防护方法流程示意图,本公开实施例适用于对网络进行安全防护的情形,该方法可以由网络安全防护装置来执行,该装置可以通过软件和/或硬件的形式实现,可选的,通过电子设备来实现,该电子设备可以是移动终端、PC端或服务器等。如图1所示,所述方法包括:FIG1 is a flowchart of a network security protection method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the situation of performing security protection on a network. The method can be executed by a network security protection device, which can be implemented in the form of software and/or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, a PC or a server. As shown in FIG1 , the method includes:
S110、拷贝第一网卡的数据包,形成镜像数据包。S110 , copying the data packet of the first network card to form a mirrored data packet.
其中,第一网卡安装于第一宿主机上。本实施例中,可以获取经过第一网卡的所有数据包,拷贝数据包,拷贝的数据包可以作为镜像数据包。The first network card is installed on the first host machine. In this embodiment, all data packets passing through the first network card can be acquired, and the data packets can be copied, and the copied data packets can be used as mirror data packets.
可选的,拷贝第一网卡的数据包,形成镜像数据包,包括:获取经过第一网卡的请求数据包和/或响应数据包;拷贝请求数据包和/或响应数据包,获得镜像数据包。Optionally, copying the data packet of the first network card to form a mirrored data packet includes: obtaining a request data packet and/or a response data packet passing through the first network card; and copying the request data packet and/or the response data packet to obtain the mirrored data packet.
需要说明的是,第一网卡可以是虚拟机(或云主机)对应的第一宿主机的网卡,虚拟机与互联网或目标主机交互的数据包均经过第一网卡。It should be noted that the first network card may be a network card of a first host machine corresponding to the virtual machine (or cloud host), and all data packets interacting between the virtual machine and the Internet or the target host pass through the first network card.
具体的,以虚拟机向目标主机发送请求数据包,或虚拟机接收目标主机的响应数据包为例。第一网卡将虚拟机生成的请求数据包发送至目标主机。当请求数据包经过第一网卡时,拷贝请求数据包(此时的请求数据包,对于第一网卡而言,可以是进方向的数据包),形成第一镜像数据包。或者;第一网卡接收目标主机发送的响应数据包,将响应数据包发送至虚拟机。当响应数据包经过第一网卡时,拷贝响应数据包(此时的响应数据包对于第一网卡而言,可以是出方向的数据包),形成第二镜像数据包。其中,镜像数据包包括第一镜像数据包和/或第二镜像数据包。Specifically, take the example of a virtual machine sending a request data packet to a target host, or a virtual machine receiving a response data packet from a target host. The first network card sends the request data packet generated by the virtual machine to the target host. When the request data packet passes through the first network card, the request data packet is copied (the request data packet at this time, for the first network card, can be a data packet in the incoming direction) to form a first mirror data packet. Or; the first network card receives a response data packet sent by the target host, and sends the response data packet to the virtual machine. When the response data packet passes through the first network card, the response data packet is copied (the response data packet at this time, for the first network card, can be a data packet in the outgoing direction) to form a second mirror data packet. Wherein, the mirror data packet includes a first mirror data packet and/or a second mirror data packet.
S120、通过第一网卡将镜像数据包发送至第二网卡。S120. Send the mirrored data packet to the second network card through the first network card.
其中,第二网卡安装于第二宿主机上。本实施例中,可以执行操作系统(如linux系统)自带的流量控制(Traffic Control,TC),以使第一网卡将镜像数据包发送至第二网卡。The second network card is installed on the second host machine. In this embodiment, the traffic control (TC) provided by the operating system (such as the Linux system) can be executed to enable the first network card to send the mirror data packet to the second network card.
S130、通过第二网卡将镜像数据包发送至引流模块。S130. Send the mirrored data packet to the traffic diversion module through the second network card.
其中,引流模块位于第三宿主机上。第二宿主机与第三宿主机可以是相同的,也可以是不同的。其中,引流模块包括第三网卡。第二网卡和第三网卡是一对虚拟网卡,虚拟网卡的特点是一边进一边出。本实施例中,可以通过第二网卡将镜像数据包(此时的镜像数据包,对于第二网卡而言,是出方向的数据包)发送至引流模块中的第三网卡。本实施例中,对于第二网卡,因为不需要“数据包回注”,即原路返回,因此只有出方向的镜像数据包,没有进方向的数据包。引流模块可以是利用操作系统(如linux系统)的netns(网络命名空间)实现的一个独立的网络空间环境。Among them, the drainage module is located on the third host machine. The second host machine and the third host machine can be the same or different. Among them, the drainage module includes a third network card. The second network card and the third network card are a pair of virtual network cards, and the characteristics of the virtual network card are one-way in and one-way out. In this embodiment, the mirror data packet (the mirror data packet at this time, for the second network card, is a data packet in the outbound direction) can be sent to the third network card in the drainage module through the second network card. In this embodiment, for the second network card, because there is no need for "data packet injection", that is, returning by the original route, there are only mirror data packets in the outbound direction, and no data packets in the inbound direction. The drainage module can be an independent network space environment implemented using the netns (network namespace) of an operating system (such as a Linux system).
可选的,镜像数据包包括目标地址,通过第二网卡将镜像数据包发送至引流模块,包括:通过第二网卡将镜像数据包中的目标地址修改为第三网卡对应的目标地址;基于修改后的目标地址将镜像数据包发送至引流模块。Optionally, the mirror data packet includes a target address, and sending the mirror data packet to the diversion module through the second network card includes: modifying the target address in the mirror data packet to the target address corresponding to the third network card through the second network card; and sending the mirror data packet to the diversion module based on the modified target address.
本实施例中,第二网卡接收到镜像数据包之后,将镜像数据包中的目标地址修改为第三网卡对应的目标地址,并基于修改后的目标地址将镜像数据包发送至引流模块,从而可以保证第二网卡将镜像数据包准确发送至第三网卡中,第三网卡能够接收镜像数据包。其中,目标地址可以是MAC地址。In this embodiment, after receiving the mirrored data packet, the second network card modifies the target address in the mirrored data packet to the target address corresponding to the third network card, and sends the mirrored data packet to the traffic diversion module based on the modified target address, thereby ensuring that the second network card accurately sends the mirrored data packet to the third network card, and the third network card can receive the mirrored data packet. The target address can be a MAC address.
S140、通过引流模块将镜像数据包发送至安全设备。S140. Send the mirrored data packet to the security device through the traffic diversion module.
其中,引流模块包括第四网卡。本实施例,第四网卡可以通过路由信息将镜像数据包发送至安全设备中。安全设备也可以称为安全实例、安全引擎等,安全设备可以是安装了防火墙安全软件的云主机或物理机器。防火墙安全软件可以是下一代防火墙(NextGeneration Firewall,NGFW)和Web应用防护系统(Web Application Firewall,WAF)等。需要说明的是,路由信息仅有一个方向的路由,即通过第四网卡将第三网卡的镜像数据包路由至安全设备中。Among them, the diversion module includes a fourth network card. In this embodiment, the fourth network card can send the mirrored data packet to the security device through routing information. The security device can also be called a security instance, a security engine, etc. The security device can be a cloud host or a physical machine with firewall security software installed. The firewall security software can be a next-generation firewall (NextGeneration Firewall, NGFW) and a Web Application Firewall (Web Application Firewall, WAF), etc. It should be noted that the routing information has only one-way routing, that is, the mirrored data packet of the third network card is routed to the security device through the fourth network card.
可选的,通过引流模块将镜像数据包发送至安全设备,包括:获取路由信息;路由信息包括至少一个安全设备的地址信息;基于路由信息将镜像数据包发送至对应的安全设备中。Optionally, sending the mirrored data packet to the security device through the traffic diversion module includes: acquiring routing information; the routing information includes address information of at least one security device; and sending the mirrored data packet to the corresponding security device based on the routing information.
本实施例中,引流模块可以将镜像数据包发送至多个安全设备,具体的,获取路由信息,基于路由信息将镜像数据包发送至对应的安全设备中。In this embodiment, the traffic diversion module may send the mirrored data packet to multiple security devices. Specifically, the traffic diversion module may obtain routing information and send the mirrored data packet to the corresponding security device based on the routing information.
S150、基于安全设备输出的安全日志对当前网络进行安全防护。S150. Perform security protection on the current network based on the security log output by the security device.
本实施例中,可以通过安全设备中防火墙软件对镜像数据包进行检查,得到检查结果,根据检查结果得到安全日志,并根据安全日志进行安全防护。In this embodiment, the mirrored data packet can be checked by the firewall software in the security device to obtain the inspection result, obtain the security log according to the inspection result, and perform security protection according to the security log.
可选的,安全日志的生成方式为:安全设备基于防火墙安全软件对镜像数据包进行安全检查,获得检查结果;若检查结果为镜像数据包为攻击镜像数据包,则输出安全日志;其中,安全日志包括五元组信息和攻击镜像数据包的攻击类型。Optionally, the security log is generated in the following manner: the security device performs a security check on the mirrored data packet based on the firewall security software to obtain the check result; if the check result is that the mirrored data packet is an attack mirrored data packet, the security log is output; wherein the security log includes five-tuple information and the attack type of the attack mirrored data packet.
其中,五元组信息可以指源IP地址(即攻击主机IP地址),源端口(即攻击主机端口),目的IP地址(即被攻击主机IP地址),目的端口(即被攻击主机端口)和传输层协议。对于具体的攻击类型,本实施例对此不作限制,例如可以是拒绝服务攻击和设定行为攻击等。本实施例中,安全设备基于防火墙安全软件对镜像数据包进行安全检查,获得检查结果;若检查结果为镜像数据包为攻击镜像数据包,即安全设备检测到网络受到安全威胁时,则输出安全日志,并丢弃攻击镜像数据包;若检查结果为镜像数据包为非攻击镜像数据包,则直接丢弃。The five-tuple information may refer to the source IP address (i.e., the attacking host IP address), the source port (i.e., the attacking host port), the destination IP address (i.e., the attacked host IP address), the destination port (i.e., the attacked host port) and the transport layer protocol. This embodiment does not limit the specific attack type, for example, it may be a denial of service attack and a set behavior attack. In this embodiment, the security device performs a security check on the mirror data packet based on the firewall security software to obtain the inspection result; if the inspection result is that the mirror data packet is an attack mirror data packet, that is, when the security device detects that the network is under a security threat, it outputs a security log and discards the attack mirror data packet; if the inspection result is that the mirror data packet is a non-attack mirror data packet, it is directly discarded.
值得注意的是,若安全设备并没有“直接丢弃”的能力,此时,可以在二层网络NET.X(如图2所示)里面选择一个“无效”的ip地址作为网关,这个ip地址是不存在的,地址解析协议ARP请求不会做出响应的地址,将这些需要“直接丢弃”的数据包送给这个网关,从而实现类似黑洞的丢弃效果。It is worth noting that if the security device does not have the ability to "directly discard", at this time, you can select an "invalid" IP address as the gateway in the second-layer network NET.X (as shown in Figure 2). This IP address does not exist and the address resolution protocol ARP request will not respond to the address. Send the data packets that need to be "directly discarded" to this gateway, thereby achieving a discarding effect similar to a black hole.
可选的,基于安全设备输出的安全日志对当前网络进行安全防护,包括:将安全日志存储至数据库中;设置已存储的安全日志的状态标识;其中,状态标识包括未处理、处理中及处理完成;根据镜像数据包的攻击类型和状态标识确定防护策略;基于防护策略对网络安全进行防护。Optionally, security protection is performed on the current network based on the security log output by the security device, including: storing the security log in a database; setting the status identifier of the stored security log; wherein the status identifier includes unprocessed, processing, and processing completed; determining a protection strategy based on the attack type and status identifier of the mirrored data packet; and protecting network security based on the protection strategy.
可选的,根据镜像数据包的攻击类型和状态标识确定防护策略,包括:若状态标识为未处理,则根据攻击类型确定防护策略,并将状态标识更新为处理中。Optionally, determining a protection strategy according to the attack type and state identifier of the mirrored data packet includes: if the state identifier is unprocessed, determining a protection strategy according to the attack type, and updating the state identifier to being processed.
其中,数据库可以是任意类型的数据库,本实施例对此不作限制。例如可以是关系型数据库mysql,也可以是其它类型的数据库,如elasticsearch数据库。本实施例中,安全设备可以将安全日志发送至云平台中的管理软件,云平台中的管理软件可以是云平台提供的安全威胁服务,云平台中的管理软件可以将安全日志存储至数据库中,设置已存储的安全日志的状态标识。若状态标识为未处理,则根据攻击类型确定防护策略,并将状态标识更新为处理中。基于防护策略对网络安全进行防护,在对网络安全进行防护进行防护之后,将状态标识更新为处理完成。本实施例,通过状态标识可以防止并发重复操作。Among them, the database can be any type of database, and this embodiment does not limit this. For example, it can be a relational database MySQL, or it can be other types of databases, such as an elasticsearch database. In this embodiment, the security device can send the security log to the management software in the cloud platform. The management software in the cloud platform can be a security threat service provided by the cloud platform. The management software in the cloud platform can store the security log in the database and set the status mark of the stored security log. If the status mark is unprocessed, the protection strategy is determined according to the attack type, and the status mark is updated to processing. Network security is protected based on the protection strategy, and after the network security is protected, the status mark is updated to processing completed. In this embodiment, concurrent repeated operations can be prevented by the status mark.
可选的,根据攻击类型确定防护策略,包括:若攻击类型为拒绝服务攻击,则防护策略为基于设定时间封禁攻击主机的地址和被攻击主机的端口;若攻击类型为设定行为攻击,则防护策略为关闭攻击主机。Optionally, a protection strategy is determined based on the attack type, including: if the attack type is a denial of service attack, the protection strategy is to block the address of the attacking host and the port of the attacked host based on a set time; if the attack type is a set behavior attack, the protection strategy is to shut down the attacking host.
本实施例中,若攻击类型为拒绝服务攻击,则防护策略为将攻击主机的地址和被攻击主机的端口封禁设定时间。若攻击类型为设定行为攻击,则防护策略为关闭攻击主机。In this embodiment, if the attack type is a denial of service attack, the protection strategy is to block the address of the attacking host and the port of the attacked host for a set time. If the attack type is a set behavior attack, the protection strategy is to shut down the attacking host.
本实施例,第一网卡、虚拟机、第二网卡、第三网卡、第四网卡、引流模块以及安全设备等均位于云平台中。In this embodiment, the first network card, the virtual machine, the second network card, the third network card, the fourth network card, the traffic diversion module and the security device are all located in the cloud platform.
需要说明的是,本实施例对镜像数据包方式、流量牵引(引流)方式、安全威胁服务分析和处理方式等均不作具体的限制,实际生产中的具体实施可以有很多种办法达到本方案中各个步骤的效果。It should be noted that this embodiment does not impose any specific restrictions on the mirroring data packet method, traffic traction (diversion) method, security threat service analysis and processing method, etc. There are many ways to achieve the effects of each step in this solution in actual production.
本公开实施例的技术方案,拷贝第一网卡的数据包,形成镜像数据包;其中,第一网卡安装于第一宿主机上;通过第一网卡将镜像数据包发送至第二网卡;其中,第二网卡安装于第二宿主机上;通过第二网卡将镜像数据包发送至引流模块;其中,引流模块位于第三宿主机上;通过引流模块将镜像数据包发送至安全设备;基于安全设备输出的安全日志对当前网络进行安全防护。本公开实施例,通过拷贝经过第一网卡的数据包,形成镜像数据包,将镜像数据包发送至引流模块中,通过引流模块将镜像数据包发送至安全设备,并基于安全设备输出的安全日志对当前网络进行安全防护的方式,可以在实现网络安全防护的同时,降低网络链路的负载,降低数据包通讯的延迟时间。The technical solution of the disclosed embodiment is to copy the data packet of the first network card to form a mirror data packet; wherein the first network card is installed on the first host machine; the mirror data packet is sent to the second network card through the first network card; wherein the second network card is installed on the second host machine; the mirror data packet is sent to the drainage module through the second network card; wherein the drainage module is located on the third host machine; the mirror data packet is sent to the security device through the drainage module; and the current network is protected based on the security log output by the security device. The disclosed embodiment copies the data packet passing through the first network card to form a mirror data packet, sends the mirror data packet to the drainage module, sends the mirror data packet to the security device through the drainage module, and protects the current network based on the security log output by the security device. This can reduce the load of the network link and reduce the delay time of data packet communication while achieving network security protection.
如图2所示,图2为本发明实施例提供的一种网络安全防护效果示意图。图2中,VM2为虚拟机2,VM2中的eth0为虚拟机2中的网卡,tap1为VM2对应的宿主机的网卡。VM1为虚拟机1,VM1中的eth0为虚拟机1中的网卡,tap0为第一网卡。If0为第二网卡,if0p为第三网卡,tt.netns为引流模块,if.x为第四网卡,NET.X为网络,NGFW为安全设备,internet为互联网,bridge为网桥,表达接入的网络是二层或三层可达。虚拟机1和虚拟机2均可以为主机或云主机。As shown in Figure 2, Figure 2 is a schematic diagram of a network security protection effect provided by an embodiment of the present invention. In Figure 2, VM2 is virtual machine 2, eth0 in VM2 is the network card in virtual machine 2, and tap1 is the network card of the host machine corresponding to VM2. VM1 is virtual machine 1, eth0 in VM1 is the network card in virtual machine 1, and tap0 is the first network card. If0 is the second network card, if0p is the third network card, tt.netns is the drainage module, if.x is the fourth network card, NET.X is the network, NGFW is the security device, internet is the Internet, and bridge is the bridge, which expresses that the accessed network is reachable at layer 2 or layer 3. Both virtual machine 1 and virtual machine 2 can be hosts or cloud hosts.
假设vm1和vm2互访,原本的网络路径是:vm1->vm1.bridge->vm2.bridge->vm2,往返同路。Assume that vm1 and vm2 visit each other. The original network path is: vm1->vm1.bridge->vm2.bridge->vm2, the same route for both directions.
对vm1的进出数据包进行了网络安全防护,传统的及时性地引流并进行安全防护的网络路径是:vm1->[tt.netns->NGFW–>tt.netns]->vm1.bridge->vm2.bridge->vm2,往返同路。Network security protection is provided for the inbound and outbound data packets of vm1. The traditional network path for timely diversion and security protection is: vm1->[tt.netns->NGFW–>tt.netns]->vm1.bridge->vm2.bridge->vm2, the same route for both round trips.
而本方案中的业务数据包的网络路径不变,和原本的网络路径一致。而“镜像”数据包的网络路径是:vm1->镜像数据包[tt.netns->ngfw]。The network path of the business data packet in this solution remains unchanged and is consistent with the original network path. The network path of the "mirror" data packet is: vm1->mirror data packet [tt.netns->ngfw].
可以看出,对于东西向流量的vm1和vm2之间的通讯,及时性网络安全防护会对所有数据包进行流量牵引(引流),牵引到安全设备后又要原路返回(tt.netns->NGFW->tt.netns)增加了网络链路的负载。而且链路路径变长,增加了单位数据包通讯的延迟时间。It can be seen that for the east-west traffic between vm1 and vm2, the timely network security protection will pull (drain) all data packets, and after pulling to the security device, it will return along the original path (tt.netns->NGFW->tt.netns), which increases the load of the network link. In addition, the link path becomes longer, which increases the delay time of the unit data packet communication.
本实施例中,拷贝经过第一网卡的数据包,形成镜像数据包,并将镜像数据包传输到安全设备上,即使用流量镜像的方式,不会对原本的数据包通讯造成影响,不会改变原本的数据包通讯的网络链路,相对原本的数据包通讯,网络延迟几乎不会有变化。“镜像的数据包”,只需要云资源到安全设备一个方向传输,安全设备检查后,若检查结果为镜像数据包为攻击镜像数据包,则发出对应的安全日志,否则不处理,最终这些数据包都会直接丢弃,无需“原路返回”,相比“传统流量牵引”去做即时性地网络安全防护的方式,减少了一倍的流量增量。对于“持久性”的恶意行为、攻击行为等威胁,以及东西向流量即内网之间的通讯,在一定取舍上,即时地分析和防护可以变得不重要,可以牺牲“及时性”来换取性能。In this embodiment, the data packet passing through the first network card is copied to form a mirror data packet, and the mirror data packet is transmitted to the security device, that is, the traffic mirroring method is used, which will not affect the original data packet communication, will not change the network link of the original data packet communication, and the network delay will hardly change relative to the original data packet communication. The "mirrored data packet" only needs to be transmitted in one direction from the cloud resource to the security device. After the security device checks, if the inspection result is that the mirror data packet is an attack mirror data packet, the corresponding security log will be issued, otherwise it will not be processed. In the end, these data packets will be directly discarded without "returning to the original route". Compared with the "traditional traffic traction" method of performing instant network security protection, the traffic increment is reduced by one half. For threats such as "persistent" malicious behavior, attack behavior, and east-west traffic, that is, communication between intranets, in a certain trade-off, instant analysis and protection can become unimportant, and "timeliness" can be sacrificed in exchange for performance.
本实施例中,在网络环境是“封闭式内网”、“基本安全”的固有条件下会显得性价比更好;在安全威胁是“持久性”、“弱(或无)破坏性”等特有条件下会显得恰到好处。In this embodiment, it will appear more cost-effective under the inherent conditions that the network environment is a "closed intranet" and "basic security"; it will appear just right under the unique conditions that the security threat is "persistent" and "weak (or non-destructive)".
示例性的,以虚拟机2对虚拟机vm1进行拒绝服务攻击为例,同时也可以参考图2。For example, take virtual machine 2 performing a denial of service attack on virtual machine vm1 as an example, and also refer to FIG. 2 .
步骤一:VM2发出syn_flood(拒绝服务攻击)攻击VM1。Step 1: VM2 sends a syn_flood (denial of service attack) to attack VM1.
其中,VM1的IP地址为10.73.14.154。具体操作为:hping3-i u1-S-p808010.73.14.154。此时VM2会发起大量的tcp syn数据包给vm1的8080端口。The IP address of VM1 is 10.73.14.154. The specific operation is: hping3-i u1-S-p808010.73.14.154. At this time, VM2 will initiate a large number of tcp syn packets to port 8080 of vm1.
步骤二:安全设备输出安全日志,并发送至安全威胁服务。Step 2: The security device outputs the security log and sends it to the security threat service.
具体操作为:Mar 1316:21:51CFW;530011001137646833922603;ipv4;3;security_flood:user_name=;src_ip=192.168.12.9;src_port=2411;dst_ip=10.73.14.154;dst_port=8080;name=synflood;type=flood-attack;protocol=TCP;mac=52:54:d5:a6:a0:ae;count=1924;level=4;in_if_name=ge1;create_time=1678695686;end_time=1678695687;extend=。安全威胁服务接收到安全日志后,存储至数据库中,设置已存储的安全日志的状态标识。The specific operation is: Mar 1316:21:51CFW; 530011001137646833922603; ipv4; 3; security_flood: user_name =; src_ip = 192.168.12.9; src_port = 2411; dst_ip = 10.73.14.154; dst_port = 8080; name = synflood; type = flood-attack; protocol = TCP; mac = 52:54: d5: a6: a0: ae; count = 1924; level = 4; in_if_name = ge1; create_time = 1678695686; end_time = 1678695687; extend =. After receiving the security log, the security threat service stores it in the database and sets the status flag of the stored security log.
步骤三:安全威胁服务对安全日志进行分析。Step 3: The security threat service analyzes the security log.
通过对安全日志进行分析,可以确定源ip是192.168.12.9(即VM2的IP地址),一秒内攻击了1924次,对10.73.14.154的8080端口进行了syncflood攻击。By analyzing the security logs, we can determine that the source IP is 192.168.12.9 (the IP address of VM2), which attacked 1924 times in one second and carried out a syncflood attack on port 8080 of 10.73.14.154.
步骤四:若状态标识为未处理,则根据拒绝服务攻击确定防护策略,并将状态标识更新为处理中。Step 4: If the status indicator is unprocessed, determine the protection strategy according to the denial of service attack and update the status indicator to processing.
其中,防护策略为:配置规则,基于设定时间封禁攻击主机的地址和被攻击主机的端口,并将状态标识更新为处理完成。The protection strategy is: configure rules, block the address of the attacking host and the port of the attacked host based on the set time, and update the status flag to complete the processing.
具体的,iptables–t filter-A FW_VM1-p tcp-s 192.168.12.9--dport8080-mtime--datestart 2023-03-13T16:21:51--datestopSpecifically, iptables –t filter-A FW_VM1 -p tcp -s 192.168.12.9 --dport8080 -mtime --datestart 2023-03-13T16:21:51 --datestop
2023-03-13T16:31:51-j DROP。2023-03-13T16:31:51-j DROP.
面对这种内网的大量数据包攻击,数据量特别大,实际生产中,由于成本等因素的考虑,安全设备负载可能会不足,甚至处理不过来,导致“及时性的处理”也会有漏网之鱼,造成网络稳定性问题。另外,平常就有大量的业务数据包要去“及时性”的处理,就会拖慢网络传输效率,也增加网络负载,使得业务的生产效率变低。因此,本方案的这种“异步方式”对当前网络进行安全防护。尽管在防护之前有一小段时间未对原本的网络进行防护,但是一旦防护,能够基于本方案的防护策略解决问题,从而能够在可容忍的时间内保证了网络的稳定性,维持了业务的稳定性。Faced with this kind of massive data packet attack on the intranet, the amount of data is particularly large. In actual production, due to cost and other factors, the security equipment may be underloaded or even unable to handle it, resulting in "timely processing" slipping through the net, causing network stability problems. In addition, there are usually a large number of business data packets that need to be processed "in a timely manner", which will slow down the network transmission efficiency and increase the network load, making the business production efficiency lower. Therefore, this "asynchronous method" of this solution provides security protection for the current network. Although the original network was not protected for a short period of time before the protection, once protected, the problem can be solved based on the protection strategy of this solution, thereby ensuring the stability of the network within a tolerable time and maintaining the stability of the business.
示例性的,本实施例所提供的技术方案,以linux系统为例,使用tc+iptables+路由信息等进行网络安全防护的数据包引流。Exemplarily, the technical solution provided in this embodiment takes the Linux system as an example and uses tc+iptables+routing information to divert data packets for network security protection.
其中,tc是linux系统内核自带的流量控制模块,能够进行数据包重定向,数据包编辑、数据包标记等功能。iptables是linux系统内核自带的ipv4数据包管理模块,能够进行数据包标记,生成连接记录等功能。ip_rule是linux系统内核自带的路由规则(或路由信息)管理功能,能够根据数据包标记配置路由发往的目标。Among them, tc is the flow control module that comes with the Linux system kernel, which can perform functions such as packet redirection, packet editing, and packet marking. Iptables is the IPv4 packet management module that comes with the Linux system kernel, which can perform functions such as packet marking and generating connection records. Ip_rule is the routing rule (or routing information) management function that comes with the Linux system kernel, which can configure the destination of the route according to the packet marking.
实际生产中,网络安全防护效果图复杂多样,配置也会有所不同,不会局限于此。但主要的工作方法和数据包处理流程是基本一致的。实际生产中,tap0也可能在某个netns里面,因为其处理方法也是一致,所以此处举例以最简单的tap0在宿主机默认的网络空间来进行阐述。In actual production, network security protection effect diagrams are complex and diverse, and the configurations will also be different, not limited to this. However, the main working methods and data packet processing procedures are basically the same. In actual production, tap0 may also be in a certain netns, because the processing method is also the same, so here we take the simplest tap0 in the default network space of the host machine as an example to illustrate.
通用配置方法:General configuration method:
定义数据包标记(bitmap)有:The defined data packet markers (bitmap) are:
#bitmap,二进制展开来看#bitmap, binary expansion
FWMARK_PASS='0xc000' #1100000000000000FWMARK_PASS='0xc000' #1100000000000000
FWMARK_SNAT='0xa000' #1010000000000000FWMARK_SNAT='0xa000' #1010000000000000
FWMARK_DNAT='0x9000' #1001000000000000FWMARK_DNAT='0x9000' #1001000000000000
FWMARK_TRACTION='0x8800' #1000100000000000FWMARK_TRACTION='0x8800' #1000100000000000
FWMARK_HASH_ROUTE1=0x8100 #1000000100000000FWMARK_HASH_ROUTE1=0x8100 #1000000100000000
占用16bit标记,从左到右依次是:Occupies 16-bit mark, from left to right:
第一位表达数据包经过了引流模块处理;The first expression data packet has been processed by the traffic diversion module;
第二位表达数据包不需要引流;The second bit expresses that the data packet does not need to be drained;
第三位表达数据包需要源地址转换;The third bit expresses that the packet requires source address translation;
第四位表达数据包需要目标地址转换;The fourth bit expresses that the packet requires destination address translation;
第五位表达数据包需要引流,在“仅南北向”引流模式的时候会用到;The fifth bit indicates that the data packet needs to be diverted, which is used in the "north-south only" diversion mode;
第六位、第七位预留;The sixth and seventh positions are reserved;
第八位表达数据包路由对象,它是进行hash计算的偏移量;The eighth bit expresses the packet routing object, which is the offset for hash calculation;
剩余8个bit即0xff表达引流目标即ngfw,引流目标可能会有多个,依次给他们做数字编号进行区分。The remaining 8 bits, i.e. 0xff, express the drainage target, i.e. ngfw. There may be multiple drainage targets, which are numbered in sequence to distinguish them.
例如hash计算得到值是1,表达编号为1的ngfw,那么数据包标记值就是0x8100+1=0x8101,路由规则(路由信息)里面会预先设置0x8101标记对应的路由策略,这样就能根据hash计算将数据包分散地发给不同的路由即不同的引流目标(ngfw)从而实现负载均衡。需要注意的是,上述的“引流”都只是对“镜像的数据包”进行。For example, if the hash calculation value is 1, which represents ngfw number 1, then the packet tag value is 0x8100+1=0x8101. The routing policy corresponding to the 0x8101 tag will be pre-set in the routing rules (routing information), so that the data packets can be distributed to different routes, that is, different diversion targets (ngfw) according to the hash calculation to achieve load balancing. It should be noted that the above-mentioned "drainage" is only performed on "mirrored data packets".
步骤一:配置网络命名空间tt.netns。Step 1: Configure the network namespace tt.netns.
创建ipset(ip集)记录租户网络(tenant_networks)信息,租户网络对云平台来说是已知的。这里的ipset会被后面提到的“租户网络”的配置步骤所使用。配置如下Create an ipset (ip set) to record the tenant network (tenant_networks) information. The tenant network is known to the cloud platform. The ipset here will be used in the "tenant network" configuration step mentioned later. The configuration is as follows
#租户网络是10.67.0.0/24,这个ip集可以配置多个网络地址段。#The tenant network is 10.67.0.0/24. This IP set can be configured with multiple network address segments.
root@topsail:~#ipset list tenant_networksroot@topsail:~#ipset list tenant_networks
Name:tenant_networksName:tenant_networks
Type:hash:netType:hash:net
Revision:6Revision:6
Header:family inet hashsize 1024maxelem 65536Header:family inet hashsize 1024maxelem 65536
Size in memory:504Size in memory:504
References:6References:6
Number of entries:1Number of entries:1
Members:Members:
10.67.0.0/2410.67.0.0/24
步骤二:配置路由规则。Step 2: Configure routing rules.
数据包需要被送往引流目标即ngfw,当ngfw有多个时候,就需要对应多条规则。可以对ngfw进行编号,然后用上述的0x8100数据包路由对象的hash计算偏移量相加,就得到数据包路由标记值。配置如下:The data packet needs to be sent to the diversion target, that is, ngfw. When there are multiple ngfws, multiple rules are required. You can number the ngfws, and then add the offset calculated by the hash of the above 0x8100 data packet routing object to get the data packet routing tag value. The configuration is as follows:
#0x8101是ngfw编号为1的路由标记值#0x8101 is the route tag value of ngfw number 1
root@topsail:~#ip rule|grep 0x81ffroot@topsail:~#ip rule|grep 0x81ff
32764:from all fwmark 0x8102/0x81ff lookup 3302632764: from all fwmark 0x8102/0x81ff lookup 33026
32765:from all fwmark 0x8101/0x81ff lookup 3302532765: from all fwmark 0x8101/0x81ff lookup 33025
#这里的ldst-br_0_p对应图2中的if.x,100.64.1.2是ngfw的ip地址。#The ldst-br_0_p here corresponds to if.x in Figure 2, and 100.64.1.2 is the IP address of ngfw.
root@topsail:~#ip route show table 0x8101root@topsail:~#ip route show table 0x8101
default via 100.64.1.2dev ldst-br_0_pdefault via 100.64.1.2dev ldst-br_0_p
100.64.1.2dev ldst-br_0_p scope link100.64.1.2dev ldst-br_0_p scope link
步骤三:配置第三网卡if0p的“进”(数据包进入netns)方向。Step 3: Configure the "in" (data packets entering netns) direction of the third network card if0p.
具体主要有以下几个部分:第一部分,设置数据包丢弃规则。当第三网卡if0配置在网桥上的时候,if0往往会收到一些广播或组播包,此时if0p也会收到这些包,可以将这些包直接丢弃不处理。具体处理方法可以是,1)设置组播、广播数据包标记为“不引流”标记;2)设置匹配到“不引流”标记就丢弃。另外,云平台或用户也可以根据需要配置不引流的ip、协议或端口等控制策略。当if0网卡不在任何网桥上的时候,它不会被动地收到数据包,所以这个部分可以不用配置。Specifically, there are several parts: The first part is to set the packet discarding rules. When the third network card if0 is configured on the bridge, if0 often receives some broadcast or multicast packets. At this time, if0p will also receive these packets, and these packets can be directly discarded without processing. The specific processing method can be: 1) set the multicast and broadcast data packets to be marked as "no diversion"; 2) set to discard when matching the "no diversion" mark. In addition, the cloud platform or users can also configure control strategies such as non-diverting IP, protocol or port as needed. When the if0 network card is not on any bridge, it will not passively receive data packets, so this part does not need to be configured.
第二部分,计算/查询得到数据包路由标记。hash计算得到引流目标的数据包标记,当引流目标即ngfw有多个的情况,可以实现负载均衡。值得一提的是,此处做连接记录(conntrack),新数据包进来可以查询连接记录得到数据包标记值,这样就不用每个数据包都进行hash计算。开启“连接记录”会消耗内存,但会降低中央处理器cpu使用且方便跟踪会话连接。不开启“连接记录”会增加中央处理器cpu使用且无法跟踪会话连接。优选的,开启“连接记录”。The second part is to calculate/query to obtain the packet routing tag. Hash calculation is used to obtain the packet tag of the diversion target. When there are multiple diversion targets, i.e., ngfw, load balancing can be achieved. It is worth mentioning that connection records (conntrack) are made here. When a new packet comes in, the connection record can be queried to obtain the packet tag value, so that hash calculation does not need to be performed on each packet. Turning on "connection records" will consume memory, but will reduce the CPU usage of the central processing unit and facilitate tracking of session connections. Not turning on "connection records" will increase the CPU usage of the central processing unit and will not be able to track session connections. Preferably, turn on "connection records".
第三部分,设置数据包NAT标记。The third part is setting the packet NAT tag.
定制化一些策略,标记数据包是否需要源地址转换或者目标地址转换。以南北向流量为例,可以做出如下策略:当数据包的源地址和目标地址都是属于租户网络的时候,不需要nat;当源地址是租户网络,目标地址非租户网络,设置源地址转换的标记;当源地址是非租户网络,目标地址是租户网络,设置目标地址转换的标记。这样设置的目的是让ngfw可以记录实际internet的会话信息,而不是私有IP到因特网IP的会话。当然,不设置nat也是可以的,看需要而定。Customize some policies to mark whether the data packet needs source address translation or destination address translation. Taking north-south traffic as an example, the following policies can be made: when the source address and destination address of the data packet both belong to the tenant network, NAT is not required; when the source address is the tenant network and the destination address is not the tenant network, set the source address translation mark; when the source address is the non-tenant network and the destination address is the tenant network, set the destination address translation mark. The purpose of this setting is to allow ngfw to record the actual Internet session information, rather than the private IP to Internet IP session. Of course, it is also possible not to set NAT, depending on the needs.
配置如下:The configuration is as follows:
第一部分:设置数据包丢弃规则。Part 1: Setting packet dropping rules.
设置组播、广播数据包标记为“不引流”Set the multicast and broadcast data packets to "not divert traffic"
filter protocol ip pref 162u32 fh 801::803order 2051key ht 801bkt0terminal flowid???not_in_hwfilter protocol ip pref 162u32 fh 801::803order 2051key ht 801bkt0terminal flowid? ? ? not_in_hw
match IP dst 224.0.0.0/4match IP dst 224.0.0.0/4
action order 1:skbedit mark 49152/0xc000 continueaction order 1:skbedit mark 49152/0xc000 continue
filter protocol ip pref 162u32 fh 801::804order 2052key ht 801bkt0terminal flowid???not_in_hwfilter protocol ip pref 162u32 fh 801::804order 2052key ht 801bkt0terminal flowid? ? ? not_in_hw
match IP dst 255.255.255.255/32match IP dst 255.255.255.255/32
action order 1:skbedit mark 49152/0xc000 continueaction order 1:skbedit mark 49152/0xc000 continue
filter protocol all pref 240fw handle 0xc000/0xc000filter protocol all pref 240fw handle 0xc000/0xc000
action order 1:gact action passaction order 1:gact action pass
#匹配到“不引流”数据包标记就丢弃#Discard the packet marked as "not draining"
root@topsail:~#iptables-t mangle-S|grep MARK_SRCroot@topsail:~#iptables-t mangle-S|grep MARK_SRC
-A PREROUTING-i if0p-j TT_MARK_SRC-A PREROUTING-i if0p-j TT_MARK_SRC
-A TT_MARK_SRC-m mark--mark 0xc000/0xc000-j DROP。-A TT_MARK_SRC-m mark--mark 0xc000/0xc000-j DROP.
第二个部分:计算/查询得到数据包路由标记。The second part: calculate/query to get the packet routing tag.
#设置if0p网卡开启连接记录,默认不开。#Set if0p network card to enable connection recording, which is disabled by default.
#root@topsail:~#iptables-t raw-S PREROUTING#root@topsail:~#iptables-t raw-S PREROUTING
-A PREROUTING-i if0p-j ACCEPT-A PREROUTING -i if0p -j ACCEPT
-A PREROUTING-j CT--notrack-A PREROUTING -j CT --notrack
#数据包路由标记#Packet routing mark
root@topsail:~#iptables-t mangle-S|grep HMARKroot@topsail:~#iptables-t mangle-S|grep HMARK
-A TT_MARK_HMARK-m conntrack--ctstate RELATED,ESTABLISHED-jCONNMARK--restore-mark--nfmask 0xffffffff--ctmask 0xffffffff#从连接记录里面查询-A TT_MARK_HMARK-m conntrack--ctstate RELATED,ESTABLISHED-jCONNMARK--restore-mark--nfmask 0xffffffff--ctmask 0xffffffff#Query from the connection record
-A TT_MARK_HMARK-m comment--comment hash_mark-m mark!--mark0x8100/0x8100-j HMARK--hmark-src-prefix 32--hmark-dst-prefix 32--hmark-rnd0x000f4243--hmark-mod 2--hmark-offset 33025#没有查到的话进行hash计算,这里的模数是2表达了引流目标即ngfw有2个。-A TT_MARK_HMARK-m comment--comment hash_mark-m mark! --mark0x8100/0x8100-j HMARK--hmark-src-prefix 32--hmark-dst-prefix 32--hmark-rnd0x000f4243--hmark-mod 2--hmark-offset 33025#If not found, perform hash calculation. The modulus here is 2, which means that there are 2 drainage targets, namely ngfw.
-A TT_MARK_HMARK-m conntrack--ctstate NEW-m mark--mark0x8100/0x8100-jCONNMARK--save-mark--nfmask 0xffffffff--ctmask0xffffffff#当新连接产生且已经计算成功得到数据包的路由标记后就保存连接记录(conntrack)-A TT_MARK_HMARK-m conntrack--ctstate NEW-m mark--mark0x8100/0x8100-jCONNMARK--save-mark--nfmask 0xffffffff--ctmask0xffffffff#When a new connection is generated and the routing mark of the data packet has been successfully calculated, the connection record is saved (conntrack)
-A TT_MARK_SRC-j TT_MARK_HMARK。-A TT_MARK_SRC -j TT_MARK_HMARK.
第三个部分,设置数据包NAT标记。The third part sets the packet NAT tag.
#南北向流量为例# Take north-south traffic as an example
root@topsail:~#iptables-t mangle-S|grep NATroot@topsail:~#iptables-t mangle-S|grep NAT
-A TT_MARK_NAT-m set--match-set tenant_networks src-m set--match-settenant_networks dst-j ACCEPT-A TT_MARK_NAT-m set--match-set tenant_networks src-m set--match-settenant_networks dst-j ACCEPT
-A TT_MARK_NAT-m comment--comment snat_mark-m set--match-set tenant_networks src-j MARK--set-xmark 0xa000/0xa000-A TT_MARK_NAT-m comment--comment snat_mark-m set--match-set tenant_networks src-j MARK--set-xmark 0xa000/0xa000
-A TT_MARK_NAT-m comment--comment dnat_mark-m set--match-set tenant_networks dst-j MARK--set-xmark 0x9000/0x9000-A TT_MARK_NAT-m comment--comment dnat_mark-m set--match-set tenant_networks dst-j MARK--set-xmark 0x9000/0x9000
-A TT_MARK_SRC-j TT_MARK_NAT。-A TT_MARK_SRC -j TT_MARK_NAT.
步骤四:配置第四网卡if.x的“出”(离开netns)方向。Step 4: Configure the "out" (leave netns) direction of the fourth network card if.x.
数据包编辑。对应NAT数据包标记进行ip地址修改,匹配到源地址转换标记,就修改源地址。匹配到目标地址转换标记,就修改目标地址。修改地址之后重新计算和修改csum值(checksum,检验和)。Data packet editing. Modify the IP address according to the NAT data packet tag. If the source address translation tag is matched, modify the source address. If the destination address translation tag is matched, modify the destination address. After modifying the address, recalculate and modify the csum value (checksum).
配置如下:The configuration is as follows:
本实施例中,仅需“镜像的数据包”发往安全设备,安全设备不需要原路往回发,不需要回注路由。In this embodiment, only the "mirrored data packet" needs to be sent to the security device, and the security device does not need to send it back along the original route, and does not need a back-injection route.
在组网方面,只需要构建安全设备和引流模块二层网络,安全设备无需做回注路由的配置,即数据包到达安全设备并经过分析处理后,就可以被丢弃或黑洞处理。In terms of networking, you only need to build a Layer 2 network of security devices and traffic diversion modules. The security devices do not need to be configured with back-injection routes. That is, after the data packets reach the security devices and are analyzed and processed, they can be discarded or black-holed.
图3为本公开实施例所提供的一种网络安全防护装置结构示意图,如图3所示,所述装置包括:数据包拷贝模块310、第一镜像数据包发送模块320、第二镜像数据包发送模块330、第三镜像数据包发送模块340及安全防护模块350。Figure 3 is a schematic diagram of the structure of a network security protection device provided by an embodiment of the present disclosure. As shown in Figure 3, the device includes: a data packet copy module 310, a first mirror data packet sending module 320, a second mirror data packet sending module 330, a third mirror data packet sending module 340 and a security protection module 350.
数据包拷贝模块310,用于拷贝第一网卡的数据包,形成镜像数据包;其中,所述第一网卡安装于第一宿主机上;The data packet copy module 310 is used to copy the data packet of the first network card to form a mirror data packet; wherein the first network card is installed on the first host machine;
第一镜像数据包发送模块320,用于通过第一网卡将所述镜像数据包发送至第二网卡;其中,所述第二网卡安装于第二宿主机上;A first mirrored data packet sending module 320, configured to send the mirrored data packet to a second network card via a first network card; wherein the second network card is installed on a second host machine;
第二镜像数据包发送模块330,用于通过所述第二网卡将所述镜像数据包发送至引流模块;其中,所述引流模块位于第三宿主机上;A second mirrored data packet sending module 330, configured to send the mirrored data packet to a traffic diversion module through the second network card; wherein the traffic diversion module is located on a third host machine;
第三镜像数据包发送模块340,用于通过所述引流模块将所述镜像数据包发送至安全设备;A third mirrored data packet sending module 340, configured to send the mirrored data packet to a security device through the traffic diversion module;
安全防护模块350,用于基于所述安全设备输出的安全日志对当前网络进行安全防护。The security protection module 350 is used to perform security protection on the current network based on the security log output by the security device.
本公开实施例的技术方案,数据包拷贝模块拷贝第一网卡的数据包,形成镜像数据包;其中,所述第一网卡安装于第一宿主机上;第一镜像数据包发送模块通过第一网卡将所述镜像数据包发送至第二网卡;其中,所述第二网卡安装于第二宿主机上;第二镜像数据包发送模块通过所述第二网卡将所述镜像数据包发送至引流模块;其中,所述引流模块位于第三宿主机上;第三镜像数据包发送模块通过所述引流模块将所述镜像数据包发送至安全设备;安全防护模块基于所述安全设备输出的安全日志对当前网络进行安全防护。本公开实施例,通过拷贝经过第一网卡的数据包,形成镜像数据包,将镜像数据包发送至引流模块中,通过引流模块将镜像数据包发送至安全设备,并基于安全设备输出的安全日志对当前网络进行安全防护的方式,可以在实现网络安全防护的同时,降低网络链路的负载,降低数据包通讯的延迟时间。The technical solution of the disclosed embodiment is that the data packet copying module copies the data packet of the first network card to form a mirror data packet; wherein the first network card is installed on the first host machine; the first mirror data packet sending module sends the mirror data packet to the second network card through the first network card; wherein the second network card is installed on the second host machine; the second mirror data packet sending module sends the mirror data packet to the drainage module through the second network card; wherein the drainage module is located on the third host machine; the third mirror data packet sending module sends the mirror data packet to the security device through the drainage module; the security protection module performs security protection on the current network based on the security log output by the security device. The disclosed embodiment forms a mirror data packet by copying the data packet passing through the first network card, sends the mirror data packet to the drainage module, sends the mirror data packet to the security device through the drainage module, and performs security protection on the current network based on the security log output by the security device. This can reduce the load of the network link and the delay time of data packet communication while achieving network security protection.
可选的,数据包拷贝模块具体用于:获取经过所述第一网卡的请求数据包和/或响应数据包;拷贝所述请求数据包和/或响应数据包,获得镜像数据包。Optionally, the data packet copy module is specifically used to: obtain a request data packet and/or a response data packet passing through the first network card; and copy the request data packet and/or the response data packet to obtain a mirrored data packet.
可选的,所述引流模块包括第三网卡;所述镜像数据包包括目标地址。可选的,第二镜像数据包发送模块具体用于:通过所述第二网卡将所述镜像数据包中的目标地址修改为所述第三网卡对应的目标地址;基于修改后的目标地址将所述镜像数据包发送至所述引流模块。Optionally, the traffic diversion module includes a third network card; the mirror data packet includes a target address. Optionally, the second mirror data packet sending module is specifically used to: modify the target address in the mirror data packet to the target address corresponding to the third network card through the second network card; and send the mirror data packet to the traffic diversion module based on the modified target address.
可选的,所述引流模块包括第四网卡。可选的,第三镜像数据包发送模块具体用于:获取路由信息;所述路由信息包括至少一个安全设备的地址信息;基于所述路由信息将所述镜像数据包发送至对应的安全设备中。Optionally, the traffic diversion module includes a fourth network card. Optionally, the third mirrored data packet sending module is specifically used to: obtain routing information; the routing information includes address information of at least one security device; and send the mirrored data packet to a corresponding security device based on the routing information.
可选的,所述安全设备安装有防火墙安全软件;所述安全日志的生成方式为:所述安全设备基于所述防火墙安全软件对所述镜像数据包进行安全检查,获得检查结果;若所述检查结果为所述镜像数据包为攻击镜像数据包,则输出安全日志;其中,所述安全日志包括五元组信息和所述攻击镜像数据包的攻击类型。Optionally, the security device is installed with firewall security software; the security log is generated as follows: the security device performs a security check on the mirror data packet based on the firewall security software to obtain a check result; if the check result is that the mirror data packet is an attack mirror data packet, a security log is output; wherein the security log includes five-tuple information and the attack type of the attack mirror data packet.
可选的,安全防护模块具体用于:将所述安全日志存储至数据库中;设置已存储的安全日志的状态标识;其中,所述状态标识包括未处理、处理中及处理完成;根据所述镜像数据包的攻击类型和所述状态标识确定防护策略;基于所述防护策略对网络安全进行防护。Optionally, the security protection module is specifically used to: store the security log in a database; set a status identifier for the stored security log; wherein the status identifier includes unprocessed, processing, and processing completed; determine a protection strategy based on the attack type of the mirrored data packet and the status identifier; and protect network security based on the protection strategy.
可选的,安全防护模块还用于:若所述状态标识为未处理,则根据所述攻击类型确定防护策略,并将所述状态标识更新为处理中。Optionally, the security protection module is further used to: if the status is marked as unprocessed, determine a protection strategy according to the attack type, and update the status to being processed.
可选的,安全防护模块还用于:若所述攻击类型为拒绝服务攻击,则防护策略为基于设定时间封禁攻击主机的地址和被攻击主机的端口;若所述攻击类型为设定行为攻击,则防护策略为关闭攻击主机。Optionally, the security protection module is also used for: if the attack type is a denial of service attack, the protection strategy is to block the address of the attacking host and the port of the attacked host based on a set time; if the attack type is a set behavior attack, the protection strategy is to shut down the attacking host.
本公开实施例所提供的一种网络安全防护装置可执行本公开任意实施例所提供的一种网络安全防护方法,具备执行方法相应的功能模块和有益效果。A network security protection device provided in an embodiment of the present disclosure can execute a network security protection method provided in any embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution method.
值得注意的是,上述装置所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本公开实施例的保护范围。It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
图4为本公开实施例所提供的一种电子设备的结构示意图。下面参考图4,其示出了适于用来实现本公开实施例的电子设备(例如图4中的终端设备或服务器)400的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图3示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。FIG4 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Referring to FIG4 below, a schematic diagram of the structure of an electronic device (e.g., a terminal device or server in FIG4 ) 400 suitable for implementing an embodiment of the present disclosure is shown. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG3 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
如图4所示,电子设备400可以包括处理装置(例如中央处理器、图形处理器等)401,其可以根据存储在只读存储器(ROM)402中的程序或者从存储装置408加载到随机访问存储器(RAM)403中的程序而执行各种适当的动作和处理。在RAM 403中,还存储有电子设备400操作所需的各种程序和数据。处理装置401、ROM 402以及RAM 403通过总线404彼此相连。编辑/输出(I/O)接口406也连接至总线404。As shown in FIG4 , the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. Various programs and data required for the operation of the electronic device 400 are also stored in the RAM 403. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An edit/output (I/O) interface 406 is also connected to the bus 404.
通常,以下装置可以连接至I/O接口406:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置406;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置407;包括例如磁带、硬盘等的存储装置408;以及通信装置409。通信装置409可以允许电子设备400与其他设备进行无线或有线通信以交换数据。虽然图4示出了具有各种装置的电子设备400,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Typically, the following devices may be connected to the I/O interface 406: input devices 406 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 408 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 409. The communication device 409 may allow the electronic device 400 to communicate wirelessly or wired with other devices to exchange data. Although FIG. 4 shows an electronic device 400 with various devices, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置409从网络上被下载和安装,或者从存储装置408被安装,或者从ROM 402被安装。在该计算机程序被处理装置401执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
本公开实施例提供的电子设备与上述实施例提供的网络安全防护方法属于同一发明构思,未在本实施例中详尽描述的技术细节可参见上述实施例,并且本实施例与上述实施例具有相同的有益效果。The electronic device provided in the embodiment of the present disclosure and the network security protection method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
本公开实施例提供了一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述实施例所提供的网络安全防护方法。An embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the network security protection method provided by the above embodiment is implemented.
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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 of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText TransferProtocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:拷贝第一网卡的数据包,形成镜像数据包;其中,所述第一网卡安装于第一宿主机上;通过第一网卡将所述镜像数据包发送至第二网卡;其中,所述第二网卡安装于第二宿主机上;通过所述第二网卡将所述镜像数据包发送至引流模块;其中,所述引流模块位于第三宿主机上;通过所述引流模块将所述镜像数据包发送至安全设备;基于所述安全设备输出的安全日志对当前网络进行安全防护。The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: copies the data packet of the first network card to form a mirror data packet; wherein the first network card is installed on the first host machine; sends the mirror data packet to the second network card through the first network card; wherein the second network card is installed on the second host machine; sends the mirror data packet to the diversion module through the second network card; wherein the diversion module is located on the third host machine; sends the mirror data packet to the security device through the diversion module; and performs security protection on the current network based on the security log output by the security device.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through 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., through the Internet using an Internet service provider).
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and/or flow chart, and the combination of the square boxes in the block diagram and/or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一获取单元还可以被描述为“获取至少两个网际协议地址的单元”。The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 of the foregoing.
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。Although the subject matter has been described in language specific to structural features and/or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310530391.7A CN116599716A (en) | 2023-05-11 | 2023-05-11 | Network security protection method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310530391.7A CN116599716A (en) | 2023-05-11 | 2023-05-11 | Network security protection method, device, equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116599716A true CN116599716A (en) | 2023-08-15 |
Family
ID=87607432
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310530391.7A Pending CN116599716A (en) | 2023-05-11 | 2023-05-11 | Network security protection method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116599716A (en) |
-
2023
- 2023-05-11 CN CN202310530391.7A patent/CN116599716A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12010135B2 (en) | Rule-based network-threat detection for encrypted communications | |
KR102451237B1 (en) | Security for container networks | |
Sun et al. | CloudEyes: Cloud‐based malware detection with reversible sketch for resource‐constrained internet of things (IoT) devices | |
US9838434B2 (en) | Creating and managing a network security tag | |
US7831822B2 (en) | Real-time stateful packet inspection method and apparatus | |
CN104205080B (en) | Unloading packet transaction is virtualized for networked devices | |
JP2009534001A (en) | Malicious attack detection system and related use method | |
RU2653241C1 (en) | Detecting a threat of a zero day with the use of comparison of a leading application/program with a user agent | |
US20170250998A1 (en) | Systems and methods of preventing infection or data leakage from contact with a malicious host system | |
US10530758B2 (en) | Methods of collaborative hardware and software DNS acceleration and DDOS protection | |
US20170201444A1 (en) | Inserting and removing stateful devices in a network | |
CN115589383A (en) | eBPF-based virtual machine data transmission method, device, equipment and storage medium | |
US10659368B2 (en) | Transparent control and transfer of network protocols | |
Yoo et al. | {SmartCookie}: Blocking {Large-Scale}{SYN} Floods with a {Split-Proxy} Defense on Programmable Data Planes | |
Barbette et al. | Building a chain of high-speed VNFs in no time | |
Barbette et al. | Combined stateful classification and session splicing for high-speed NFV service chaining | |
CN116599716A (en) | Network security protection method, device, equipment and medium | |
CN115190107B (en) | Multi-subsystem management method based on extensive domain name, management terminal and readable storage medium | |
US20160337232A1 (en) | Flow-indexing for datapath packet processing | |
CN113905013B (en) | Method for realizing IP address transparent transmission for cluster network | |
US11457095B1 (en) | Stateless communication using a stateful protocol | |
You et al. | Hyperion: Hardware-Based High-Performance and Secure System for Container Networks | |
US20120201142A1 (en) | Data Packet Interception System | |
US20230140555A1 (en) | Transparent network service chaining | |
RU2820803C1 (en) | Method and system for tunneling traffic in distributed network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Country or region after: China Address after: Unit 501A, Floor 5, 101, Building 1 to 16, Yard 5, Laiguangying West Road, Chaoyang District, Beijing, 100020 Applicant after: Beijing Qingyun Technology Group Co.,Ltd. Address before: Unit 501A, Floor 5, 101, Building 1 to 16, Yard 5, Laiguangying West Road, Chaoyang District, Beijing, 100020 Applicant before: Beijing Qingyun Science and Technology Co.,Ltd. Country or region before: China |
|
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Country or region after: China Address after: Room 1101, 11th Floor, Building 9, No. 6 Jiuxianqiao Road, Chaoyang District, Beijing 100015, China Applicant after: Beijing Qingyun Technology Group Co.,Ltd. Address before: Unit 501A, Floor 5, 101, Building 1 to 16, Yard 5, Laiguangying West Road, Chaoyang District, Beijing, 100020 Applicant before: Beijing Qingyun Technology Group Co.,Ltd. Country or region before: China |
|
CB02 | Change of applicant information |