[go: up one dir, main page]

CN116455801A - Method and device for acquiring full path network access relation - Google Patents

Method and device for acquiring full path network access relation Download PDF

Info

Publication number
CN116455801A
CN116455801A CN202310454802.9A CN202310454802A CN116455801A CN 116455801 A CN116455801 A CN 116455801A CN 202310454802 A CN202310454802 A CN 202310454802A CN 116455801 A CN116455801 A CN 116455801A
Authority
CN
China
Prior art keywords
network
nat device
nat
destination
session
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.)
Granted
Application number
CN202310454802.9A
Other languages
Chinese (zh)
Other versions
CN116455801B (en
Inventor
郭曦拓
徐徽
周明嘉
张佳温
张祥
颜回中
陈梓忠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Guangfa Bank Co Ltd
Original Assignee
China Guangfa Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Guangfa Bank Co Ltd filed Critical China Guangfa Bank Co Ltd
Priority to CN202310454802.9A priority Critical patent/CN116455801B/en
Publication of CN116455801A publication Critical patent/CN116455801A/en
Application granted granted Critical
Publication of CN116455801B publication Critical patent/CN116455801B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/04Interdomain routing, e.g. hierarchical routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/256NAT traversal
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请公开了一种获取全路径网络访问关系的方法及装置。其中,该方法包括:获取与多个NAT设备中每个NAT设备对应的结构化会话日志;根据每个NAT设备对应的结构化会话日志,提取网络会话在每个NAT设备处的局部网络访问关系,其中,网络会话为在每个NAT设备所属的网络边界内的设备和在每个NAT设备所属的网络边界外的设备之间进行的会话;将网络会话在每个NAT设备处的局部网络访问关系进行串联,得到每个NAT设备所属的网络边界的全路径网络访问关系。本申请解决了由于NAT环境复杂造成的相关技术无法高效且准确的获取到穿越NAT设备的全路径网络访问关系的技术问题。

The present application discloses a method and a device for acquiring full-path network access relationships. Wherein, the method includes: obtaining a structured session log corresponding to each NAT device in a plurality of NAT devices; extracting the local network access relationship of the network session at each NAT device according to the structured session log corresponding to each NAT device , wherein the network session is a session between a device within the network boundary to which each NAT device belongs and a device outside the network boundary to which each NAT device belongs; the network session is accessed locally at each NAT device Relationships are concatenated to obtain the full-path network access relationship of the network boundary to which each NAT device belongs. The present application solves the technical problem that related technologies cannot efficiently and accurately obtain the full-path network access relationship traversing the NAT device due to the complexity of the NAT environment.

Description

获取全路径网络访问关系的方法及装置Method and device for obtaining full-path network access relationship

技术领域technical field

本申请涉及网络通信技术领域,具体而言,涉及一种获取全路径网络访问关系的方法及装置。The present application relates to the technical field of network communication, in particular, to a method and device for obtaining full-path network access relationships.

背景技术Background technique

随着线上业务的发展,企业内网同互联网、外联网之间的通讯日益频繁,同时网络安全边界暴露面的安全风险也日益增加;快速获取安全边界网络访问关系对定位边界攻击事件十分关键。由于网络访问通讯会话经过安全边界后,访问关系中的源网络地址(Internet Protocol,IP)、目标IP和目标端口等信息均有可能发生一次或多次转换,相关技术无法在类似上述存在复杂网络地址转换(Network Address Translation,NAT)的环境中高效且准确的获取到穿越安全边界的全路径网络访问关系。With the development of online business, the communication between the enterprise intranet and the Internet and extranet is becoming more and more frequent. At the same time, the security risk of the exposed surface of the network security boundary is also increasing; quickly obtaining the network access relationship of the security boundary is very important for locating the boundary attack incident . Since the network access communication session passes through the security boundary, information such as the source network address (Internet Protocol, IP), target IP, and target port in the access relationship may undergo one or more conversions. In an address translation (Network Address Translation, NAT) environment, the full-path network access relationship across the security boundary is efficiently and accurately obtained.

针对上述的问题,目前尚未提出有效的解决方案。For the above problems, no effective solution has been proposed yet.

发明内容Contents of the invention

本申请实施例提供了一种获取全路径网络访问关系的方法及装置,以至少解决由于NAT环境复杂造成的相关技术无法高效且准确的获取到穿越NAT设备的全路径网络访问关系的技术问题。Embodiments of the present application provide a method and device for obtaining full-path network access relationships, to at least solve the technical problem that related technologies cannot efficiently and accurately obtain full-path network access relationships traversing NAT devices due to the complexity of the NAT environment.

根据本申请实施例的一个方面,提供了一种获取全路径网络访问关系的方法,包括:获取与多个NAT设备中每个NAT设备对应的结构化会话日志;根据每个NAT设备对应的结构化会话日志,提取网络会话在每个NAT设备处的局部网络访问关系,其中,网络会话为在每个NAT设备所属的网络边界内的设备和在每个NAT设备所属的网络边界外的设备之间进行的会话;将网络会话在每个NAT设备处的局部网络访问关系进行串联,得到每个NAT设备所属的网络边界的全路径网络访问关系。According to an aspect of the embodiment of the present application, there is provided a method for obtaining a full-path network access relationship, including: obtaining a structured session log corresponding to each NAT device in a plurality of NAT devices; according to the structure corresponding to each NAT device The session log is extracted to extract the local network access relationship of the network session at each NAT device, where the network session is between the device within the network boundary to which each NAT device belongs and the device outside the network boundary to which each NAT device belongs Conversations conducted between them; the local network access relationship of the network session at each NAT device is connected in series to obtain the full-path network access relationship of the network boundary to which each NAT device belongs.

可选地,根据每个NAT设备对应的结构会话化日志,提取网络会话在每个NAT设备处的局部网络访问关系,包括:获取NAT设备的网络边界拓扑关系,根据网络边界拓扑关系生成NAT设备的出入路径表,其中,NAT设备的出入路径表包括:NAT设备的标识信息、NAT设备所在的网络边界的名称、NAT设备的级联层级,经过NAT设备的网络会话的访问方向、入接口的名称和出接口的名称,入接口为网络会话进入NAT设备的接口,出接口为网络会话从NAT设备出来的接口;根据结构化会话日志生成日志汇聚表,并依据NAT设备的出入路径表和日志汇聚表确定经过NAT设备的网络会话的访问方向;根据访问方向提取网络会话在NAT设备处的局部网络访问关系。Optionally, according to the structural session log corresponding to each NAT device, extract the local network access relationship of the network session at each NAT device, including: obtaining the network boundary topology relationship of the NAT device, and generating the NAT device according to the network boundary topology relationship The entry and exit path table of the NAT device, wherein the entry and exit path table of the NAT device includes: the identification information of the NAT device, the name of the network boundary where the NAT device is located, the cascading level of the NAT device, the access direction of the network session passing through the NAT device, and the The name and the name of the outgoing interface, the incoming interface is the interface through which the network session enters the NAT device, and the outgoing interface is the interface through which the network session exits from the NAT device; the log aggregation table is generated according to the structured session log, and based on the entry and exit path table and logs of the NAT device The aggregation table determines the access direction of the network session passing through the NAT device; extracts the local network access relationship of the network session at the NAT device according to the access direction.

可选地,获取与多个NAT设备中每个NAT设备对应的结构化会话日志,包括:获取多个NAT设备的多个日志,从多个日志中获取关键要素信息,其中,关键要素信息包括:时间戳、源网络地址、目的网络地址、目的端口、源映射网络地址、目的映射网络地址、目的映射端口、协议类型、源接口和目的接口;获取每个NAT设备的标识信息,其中,标识信息包括以下至少之一:NAT设备的名称和NAT设备的网络地址;将每个NAT设备的关键要素信息和每个NAT设备的标识信息进行组合,得到每个NAT设备对应的结构化会话日志。Optionally, obtaining a structured session log corresponding to each NAT device in the multiple NAT devices includes: obtaining multiple logs of the multiple NAT devices, and obtaining key element information from the multiple logs, wherein the key element information includes : Timestamp, source network address, destination network address, destination port, source-mapped network address, destination-mapped network address, destination-mapped port, protocol type, source interface, and destination interface; obtain the identification information of each NAT device, among which, the identification The information includes at least one of the following: the name of the NAT device and the network address of the NAT device; the key element information of each NAT device and the identification information of each NAT device are combined to obtain a structured session log corresponding to each NAT device.

可选地,根据结构化会话日志生成日志汇聚表,包括:确定预设周期,并采集在预设周期内的多个结构化会话日志;将多个结构化会话日志中除时间戳以外的其它关键要素信息完全相同的数据归类为一组数据,得到多组数据;根据多组数据生成日志汇聚表,其中,日志汇聚表包括:NAT设备的标识信息、关键要素信息和每组数据出现的次数。Optionally, generating a log aggregation table according to the structured session log includes: determining a preset period, and collecting multiple structured session logs within the preset period; Data with exactly the same key element information is classified into one set of data to obtain multiple sets of data; a log aggregation table is generated based on multiple sets of data, wherein the log aggregation table includes: NAT device identification information, key element information, and the occurrence of each set of data frequency.

可选地,根据结构化会话日志生成日志汇聚表,并依据NAT设备的出入路径表和日志汇聚表确定经过NAT设备的网络会话的访问方向,包括:获取日志汇聚表中的NAT设备的标识信息、与NAT设备的标识信息对应的源接口的名称以及与NAT设备的标识信息对应的目的接口的名称;利用NAT设备的标识信息、与NAT设备的标识信息对应的源接口的名称和与NAT设备的标识信息对应的目的接口的名称通过NAT设备的出入路径表确定经过NAT设备的标识信息指示的NAT设备的网络会话的访问方向。Optionally, generate a log aggregation table according to the structured session log, and determine the access direction of the network session passing through the NAT device according to the in-out path table and the log aggregation table of the NAT device, including: obtaining the identification information of the NAT device in the log aggregation table , the name of the source interface corresponding to the identification information of the NAT device and the name of the destination interface corresponding to the identification information of the NAT device; using the identification information of the NAT device, the name of the source interface corresponding to the identification information of the NAT device and the The name of the destination interface corresponding to the identification information of the NAT device determines the access direction of the network session passing through the NAT device indicated by the identification information of the NAT device through the ingress and egress path table of the NAT device.

可选地,根据访问方向提取网络会话在NAT设备处的局部网络访问关系,包括:如果访问方向为入界,将与NAT设备的标识信息对应的源映射网络地址确定为内接口源网络地址,将与NAT设备的标识信息对应的目的网络地址确定为内接口目的网络地址,将与NAT设备的标识信息对应的目的端口确定为内接口目的端口,将与NAT设备的标识信息对应的源网络地址确定为外接口源网络地址,将与NAT设备的标识信息对应的目的映射网络地址确定为外接口目的网络地址,并将与NAT设备的标识信息对应的目的映射端口确定为外接口目的端口,其中,入界指示从网络边界外的设备访问网络边界内的设备;根据内接口源网络地址、内接口目的网络地址、内接口目的端口、外接口源网络地址、外接口目的网络地址和外接口目的端口确定访问方向为入界时网络会话在NAT设备处的多个局部网络访问关系;如果访问方向为出界,将与NAT设备的标识信息对应的源网络地址确定为内接口源网络地址、将与NAT设备的标识信息对应的目的映射网络地址确定为内接口目的网络地址、将与NAT设备的标识信息对应的目的映射端口确定为内接口目的端口、将与NAT设备的标识信息对应的源映射网络地址确定为外接口源网络地址、将与NAT设备的标识信息对应的目的网络地址确定为外接口目的网络地址,并将与NAT设备的标识信息对应的目的端口确定为外接口目的端口,其中,出界指示从网络边界内的设备访问网络边界外的设备;根据内接口源网络地址、内接口目的网络地址、内接口目的端口、外接口源网络地址、外接口目的网络地址和外接口目的端口确定访问方向为出界时网络会话在NAT设备处的多个局部网络访问关系。Optionally, extracting the local network access relationship of the network session at the NAT device according to the access direction includes: if the access direction is inbound, determining the source mapping network address corresponding to the identification information of the NAT device as the internal interface source network address, Determine the destination network address corresponding to the identification information of the NAT device as the internal interface destination network address, determine the destination port corresponding to the identification information of the NAT device as the destination port of the internal interface, and determine the source network address corresponding to the identification information of the NAT device Determine as the external interface source network address, determine the destination mapping network address corresponding to the identification information of the NAT equipment as the external interface destination network address, and determine the destination mapping port corresponding to the identification information of the NAT equipment as the external interface destination port, wherein , ingress indicates that a device outside the network boundary accesses a device inside the network boundary; according to the source network address of the internal interface, the destination network address of the internal interface, the destination port of the internal interface, the source network address of the external interface, the destination network address of the external interface, and the destination network address of the external interface When the port determines that the access direction is inbound, the network session has multiple local network access relationships at the NAT device; if the access direction is outbound, the source network address corresponding to the identification information of the NAT device is determined as the source network address of the internal interface, and will be related to The destination mapping network address corresponding to the identification information of the NAT device is determined as the internal interface destination network address, the destination mapping port corresponding to the identification information of the NAT device is determined as the destination port of the internal interface, and the source mapping network corresponding to the identification information of the NAT device is determined. The address is determined as the source network address of the external interface, the destination network address corresponding to the identification information of the NAT device is determined as the destination network address of the external interface, and the destination port corresponding to the identification information of the NAT device is determined as the destination port of the external interface, wherein, Out-of-bounds indicates access to devices outside the network boundary from devices within the network boundary; determined according to the source network address of the internal interface, the destination network address of the internal interface, the destination port of the internal interface, the source network address of the external interface, the destination network address of the external interface, and the destination port of the external interface When the access direction is out of bounds, multiple local network access relationships of the network session at the NAT device.

可选地,将每个NAT设备的局部网络访问关系进行串联,得到每个NAT设备所属的网络边界的全路径网络访问关系,包括:从NAT设备的出入路径表中确定NAT设备所属的网络边界中NAT设备的数量;如果数量大于一个,依据串联规则将同一个网络边界内的多个NAT设备的多个局部网络访问关系进行串联,得到全路径网络访问关系;如果数量等于一个,将NAT设备的局部网络访问关系确定为全路径网络访问关系。Optionally, the local network access relationship of each NAT device is connected in series to obtain the full-path network access relationship of the network boundary to which each NAT device belongs, including: determining the network boundary to which the NAT device belongs from the in-out path table of the NAT device The number of NAT devices in the network; if the number is greater than one, connect the multiple local network access relationships of multiple NAT devices within the same network boundary in series according to the concatenation rules to obtain the full-path network access relationship; if the number is equal to one, connect the NAT devices The partial network access relationship of is determined as the full path network access relationship.

可选地,依据串联规则将同一个网络边界内的多个NAT设备的多个局部网络访问关系进行串联,包括:如果多个NAT设备中的第一NAT设备的内接口源网络地址等于多个NAT设备中的第二NAT设备的外接口源网络地址,第一NAT设备的内接口目的网络地址等于第二NAT设备的外接口目的网络地址,且第一NAT设备的内接口目的端口等于第二NAT设备的外接口目的端口,将第一NAT设备的局部网络访问关系和第二NAT设备的局部网络访问关系串联为网络边界的全路径访问关系,其中,第一NAT设备与第二NAT设备为属于同一个网络边界,第一NAT设备与第二NAT设备存在相邻的关系,且第一NAT设备的级联层级小于第二NAT设备的级联层级。Optionally, the multiple local network access relationships of multiple NAT devices within the same network boundary are connected in series according to the concatenation rules, including: if the internal interface source network address of the first NAT device among the multiple NAT devices is equal to multiple The external interface source network address of the second NAT equipment in the NAT equipment, the internal interface destination network address of the first NAT equipment is equal to the external interface destination network address of the second NAT equipment, and the internal interface destination port of the first NAT equipment is equal to the second The destination port of the external interface of the NAT device connects the local network access relationship of the first NAT device and the local network access relationship of the second NAT device in series to form a full-path access relationship at the network boundary, wherein the first NAT device and the second NAT device are Belonging to the same network boundary, the first NAT device and the second NAT device have an adjacent relationship, and the cascading level of the first NAT device is smaller than the cascading level of the second NAT device.

可选地,获取全路径网络访问关系的方法还包括:将全路径网络访问关系中发起访问请求的设备对应的节点确定为开始节点,将全路径网络访问关系中接收访问请求的设备对应的节点确定为结束节点,并将全路径网络访问关系中的NAT设备确定为中间节点;将连接开始节点,中间节点和结束节点的线段确定为边,其中,边的方向根据网络会话穿过网络边界的访问方向确定,边的方向用箭头指示;根据开始节点、中间节点、结束节点和边生成全路径网络访问关系的可视图;展示全路径网络访问关系的可视图。Optionally, the method for obtaining the full-path network access relationship further includes: determining the node corresponding to the device that initiates the access request in the full-path network access relationship as the starting node, and determining the node corresponding to the device that receives the access request in the full-path network access relationship Determine as the end node, and determine the NAT device in the full-path network access relationship as the intermediate node; determine the line segment connecting the start node, the intermediate node and the end node as an edge, wherein the direction of the edge passes through the network boundary according to the network session The access direction is determined, and the direction of the edge is indicated by an arrow; a visual view of the full-path network access relationship is generated according to the start node, intermediate node, end node, and edge; a visual view of the full-path network access relationship is displayed.

根据本申请实施例的另一方面,还提供了一种全路径网络访问关系的展示系统,包括:终端设备、数据可视化服务器和数据处理服务器,其中,终端设备,与数据可视化服务器连接,用于向数据可视化服务器发送用于请求访问网络边界的全路径网络访问关系的查询请求,并展示全路径网络访问关系;数据可视化服务器,与数据处理服务器连接,用于响应查询请求并获取与全路径网络访问关系对应的数据;数据处理服务器,用于获取多个NAT设备的多个日志,将多个日志转换为与多个NAT设备中每个NAT设备对应的结构化会话日志,根据每个NAT设备对应的结构化会话日志,提取网络会话在每个NAT设备处的局部网络访问关系,将在每个NAT设备处的局部网络访问关系进行串联,得到每个NAT设备所属的网络边界的全路径网络访问关系,存储与全路径网络访问关系对应的数据,并向数据可视化服务器下发与全路径网络访问关系对应的数据,其中,网络会话为在网络边界内的设备和在网络边界外的设备之间进行的会话。According to another aspect of the embodiment of the present application, there is also provided a system for displaying full-path network access relationships, including: a terminal device, a data visualization server, and a data processing server, wherein the terminal device is connected to the data visualization server for Send a query request to the data visualization server to request access to the full-path network access relationship of the network boundary, and display the full-path network access relationship; the data visualization server, connected to the data processing server, is used to respond to the query request and obtain information related to the full-path network The data corresponding to the access relationship; the data processing server is used to obtain multiple logs of multiple NAT devices, and convert the multiple logs into structured session logs corresponding to each NAT device in the multiple NAT devices, according to each NAT device The corresponding structured session log extracts the local network access relationship of the network session at each NAT device, connects the local network access relations at each NAT device in series, and obtains the full-path network of the network boundary to which each NAT device belongs Access relationship, store the data corresponding to the full-path network access relationship, and send the data corresponding to the full-path network access relationship to the data visualization server, where the network session is between a device within the network boundary and a device outside the network boundary conversations in between.

根据本申请实施例的另一方面,还提供了一种获取全路径网络访问关系的装置,包括:获取模块,用于获取与多个NAT设备中每个NAT设备对应的结构化会话日志;提取模块,用于根据每个NAT设备对应的结构化会话日志,提取网络会话在每个NAT设备处的局部网络访问关系,其中,网络会话为在每个NAT设备所属的网络边界内的设备和在每个NAT设备所属的网络边界外的设备之间进行的会话;处理模块,用于将网络会话在每个NAT设备处的局部网络访问关系进行串联,得到每个NAT设备所属的网络边界的全路径网络访问关系。According to another aspect of the embodiment of the present application, there is also provided an apparatus for obtaining a full-path network access relationship, including: an obtaining module, configured to obtain a structured session log corresponding to each NAT device in a plurality of NAT devices; extract A module, configured to extract the local network access relationship of the network session at each NAT device according to the structured session log corresponding to each NAT device, wherein the network session is a device within the network boundary to which each NAT device belongs and at the Conversations between devices outside the network boundary to which each NAT device belongs; a processing module, configured to connect the local network access relationships of network sessions at each NAT device in series, to obtain a full view of the network boundary to which each NAT device belongs Path network access relationship.

根据本申请实施例的另一方面,还提供了一种非易失性存储介质,该非易失性存储介质中存储有计算机程序,其中,非易失性存储介质所在设备通过运行计算机程序执行上述的全路径网络访问关系的方法。According to another aspect of the embodiment of the present application, there is also provided a non-volatile storage medium, which stores a computer program, wherein the device where the non-volatile storage medium is located executes the computer program by running the computer program. The above-mentioned full-path network access relationship method.

根据本申请实施例的另一方面,还提供了一种电子装置,包括存储器和处理器,存储器中存储有计算机程序,处理器被设置为通过计算机程序执行上述的全路径网络访问关系的方法。According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above-mentioned full-path network access relationship method through the computer program.

在本申请实施例中,采用获取与多个NAT设备中每个NAT设备对应的结构化会话日志;根据每个NAT设备对应的结构化会话日志,提取网络会话在每个NAT设备处的局部网络访问关系,其中,网络会话为在每个NAT设备所属的网络边界内的设备和在每个NAT设备所属的网络边界外的设备之间进行的会话;将网络会话在每个NAT设备处的局部网络访问关系进行串联,得到每个NAT设备所属的网络边界的全路径网络访问关系的方式,通过采集边界网络路径中多个NAT设备节点前后的局部网络访问关系,对边界路径中多个节点采集的局部网络访问关系进行串联匹配,达到了获取并展示穿越NAT设备所在的网络边界的全路径网络访问关系的目的,从而实现了在NAT设备中存在一对多映射、多对一映射、关联了策略路由(Policy Based Routing,PBR)的地址映射、端口映射等复杂的NAT配置的应用场景下,以及存在多台NAT设备级联的复杂应用场景下仍能够准确且高效的获取穿越NAT设备的全路径网络访问关系的技术效果,进而解决了由于NAT环境复杂造成的相关技术无法高效且准确的获取到穿越NAT设备的全路径网络访问关系技术问题。In the embodiment of the present application, the structured session log corresponding to each NAT device in multiple NAT devices is obtained; according to the structured session log corresponding to each NAT device, the local network of the network session at each NAT device is extracted Access relationship, wherein, the network session is a session between a device within the network boundary to which each NAT device belongs and a device outside the network boundary to which each NAT device belongs; the network session is localized at each NAT device The network access relationship is connected in series to obtain the full-path network access relationship of the network boundary to which each NAT device belongs. The local network access relationship of the NAT device is serially matched to achieve the purpose of obtaining and displaying the full-path network access relationship across the network boundary where the NAT device is located, thereby realizing the existence of one-to-many mapping, many-to-one mapping, and association in the NAT device. In the application scenarios of complex NAT configurations such as Policy Based Routing (PBR) address mapping and port mapping, and in complex application scenarios where multiple NAT devices are cascaded, it is still possible to accurately and efficiently obtain the full information of traversing NAT devices. The technical effect of the path network access relationship further solves the technical problem that related technologies cannot efficiently and accurately obtain the full path network access relationship through the NAT device due to the complexity of the NAT environment.

附图说明Description of drawings

此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The schematic embodiments and descriptions of the application are used to explain the application and do not constitute an improper limitation to the application. In the attached picture:

图1是根据本申请实施例的一种获取全路径网络访问关系的方法的流程图;FIG. 1 is a flow chart of a method for acquiring full-path network access relationships according to an embodiment of the present application;

图2是根据本申请实施例的一种日志汇聚表的示意图;FIG. 2 is a schematic diagram of a log aggregation table according to an embodiment of the present application;

图3是根据本申请实施例的一种网络边界拓扑图的示意图;FIG. 3 is a schematic diagram of a network boundary topology diagram according to an embodiment of the present application;

图4是根据本申请实施例的一种NAT设备的出入路径表的示意图;FIG. 4 is a schematic diagram of an ingress and egress path table of a NAT device according to an embodiment of the present application;

图5是根据本申请实施例的一种全路径网络访问关系表的示意图;FIG. 5 is a schematic diagram of an all-path network access relationship table according to an embodiment of the present application;

图6是根据本申请实施例的一种全路径网络访问关系可视图的示意图;FIG. 6 is a schematic diagram of a full-path network access relationship visual view according to an embodiment of the present application;

图7是根据本申请实施例的一种全路径网络访问关系的展示系统的结构图;FIG. 7 is a structural diagram of a system for displaying full-path network access relationships according to an embodiment of the present application;

图8是根据本申请实施例的一种全路径网络访问关系的展示系统的工作流程图;Fig. 8 is a working flow diagram of a system for displaying full-path network access relationships according to an embodiment of the present application;

图9是根据本申请实施例的一种全路径网络访问关系的装置的结构图。FIG. 9 is a structural diagram of an apparatus for an all-path network access relationship according to an embodiment of the present application.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the application. Obviously, the described embodiment is only It is an embodiment of a part of the application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.

需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first" and "second" in the description and claims of the present application and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.

为了更好地理解本申请实施例,以下将本申请实施例中涉及的技术术语解释如下:In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:

NAT设备:具备对网络通讯中的IP数据包中的源IP、目的IP和目的端口等进行转换功能的设备;本申请实施例中的NAT设备可以是防火墙、负载均衡器、交换机、路由器、NAT网关等具备NAT功能的设备,设备形态上,可以是物理设备,也可以是虚拟服务器和云服务器。NAT device: a device capable of converting source IP, destination IP, and destination port in IP data packets in network communication; the NAT device in the embodiment of the present application can be a firewall, a load balancer, a switch, a router, or a NAT Devices with NAT functions such as gateways can be physical devices, virtual servers and cloud servers in terms of device form.

时间戳:通过数字签名技术产生的数据,用于认证签名对象的产生时间,在本申请实施例中,每条日志的时间戳用于指示每条日志的产生时间。Timestamp: The data generated by digital signature technology is used to verify the generation time of the signature object. In the embodiment of this application, the timestamp of each log is used to indicate the generation time of each log.

源网络地址(源IP):表示真实源IP,即客户端侧发起的数据包进入NAT设备之前的IP包报文中源地址字段的IP值。Source network address (source IP): Indicates the real source IP, that is, the IP value of the source address field in the IP packet before the data packet initiated by the client side enters the NAT device.

源映射网络地址(源映射IP):表示客户端侧发起的数据包穿越NAT设备出来后的IP包报文中源地址字段的IP值。Source-mapped network address (source-mapped IP): Indicates the IP value of the source address field in the IP packet message after the data packet initiated by the client side passes through the NAT device.

目的网络地址(目的IP):表示真实目的IP,即客户端侧发起的数据包穿越NAT设备之后的IP包报文中目的地址字段的IP值。Destination network address (destination IP): Indicates the real destination IP, that is, the IP value of the destination address field in the IP packet after the data packet initiated by the client side passes through the NAT device.

目的映射网络地址(目的映射IP):表示客户端侧发起的数据包进入NAT设备之前的IP包报文中的目的地址字段的IP值。Destination mapping network address (destination mapping IP): Indicates the IP value of the destination address field in the IP packet message before the data packet initiated by the client side enters the NAT device.

目的端口:表示真实目的端口,即客户端侧发起的数据包穿越NAT设备之后的IP包报文中目的端口字段的端口值。Destination port: Indicates the real destination port, that is, the port value of the destination port field in the IP packet after the data packet initiated by the client side passes through the NAT device.

目的映射端口:表示客户端侧发起的数据包进入NAT设备之前的IP包报文中的目的端口字段的端口值。Destination mapping port: Indicates the port value of the destination port field in the IP packet before the data packet initiated by the client side enters the NAT device.

内接口:表示NAT设备靠近内部网络的一侧的接口;当外部网络客户端主动访问内部网络时,是数据包的出接口;当内部网络客户端主动访问外部网络时,是数据包的入接口。Internal interface: indicates the interface on the side of the NAT device close to the internal network; when the external network client actively accesses the internal network, it is the outgoing interface of the data packet; when the internal network client actively accesses the external network, it is the incoming interface of the data packet .

外接口:表示NAT设备靠近外部网络一侧的接口;当外部网络客户端主动访问内部网络时,是数据包的入接口;当内部网络客户端主动访问外部网络时,是数据包的出接口。External interface: indicates the interface on the side of the NAT device close to the external network; when the external network client actively accesses the internal network, it is the incoming interface of the data packet; when the internal network client actively accesses the external network, it is the outgoing interface of the data packet.

内接口源网络地址(内接口源IP):表示客户端侧发起的数据包在NAT设备内接口侧IP包报文中源IP字段的IP值。Internal interface source network address (internal interface source IP): Indicates the IP value of the source IP field in the IP packet message on the internal interface side of the NAT device for data packets initiated by the client side.

内接口目的网络地址(内接口目的IP):表示客户端侧发起的数据包在NAT设备内接口侧IP包报文中目的IP字段的IP值。Internal interface destination network address (internal interface destination IP): Indicates the IP value of the destination IP field in the IP packet message on the internal interface side of the NAT device for data packets initiated by the client side.

内接口目的端口:表示客户端侧发起的数据包在NAT设备内接口侧IP包报文中目的端口字段的端口值。Destination port of internal interface: Indicates the port value of the destination port field in the IP packet message of the internal interface side of the NAT device for the data packet initiated by the client side.

外接口源网络地址(外接口源IP):表示客户端侧发起的数据包在NAT设备外接口侧IP包报文中源IP字段的IP值。External interface source network address (external interface source IP): Indicates the IP value of the source IP field in the IP packet message on the external interface side of the NAT device for data packets initiated by the client side.

外接口目的网络地址(外接口目的IP):表示客户端侧发起的数据包在NAT设备外接口侧IP包报文中目的IP字段的IP值。Destination network address of the external interface (destination IP of the external interface): indicates the IP value of the destination IP field in the IP packet message on the external interface side of the NAT device of the data packet initiated by the client side.

外接口目的端口:表示客户端侧发起的数据包在NAT设备外接口侧IP包报文中目的端口字段的端口值。External interface destination port: Indicates the port value of the destination port field in the IP packet message on the external interface side of the NAT device for data packets initiated by the client side.

局部网络访问关系:网络安全边界拓扑路径中某个具体位置观测到的网络流量中的访问关系,在本申请实施例中用客户端发起的数据包中的“源IP、目的IP、目的端口和协议”共同表示一个网络访问关系。Local network access relationship: the access relationship in the network traffic observed at a specific location in the topological path of the network security boundary. In the embodiment of this application, the "source IP, destination IP, destination port and Agreement" collectively represent a network access relationship.

全路径网络访问关系:经过NAT设备后,局部网络访问关系将发生转换。将网络安全边界路径中每个NAT设备前后的局部网络访问关系按顺序进行串联匹配后,得到的穿越整个网络安全边界的全路径网络访问关系。Full-path network access relationship: After passing through the NAT device, the local network access relationship will be converted. After the local network access relationship before and after each NAT device in the network security boundary path is serially matched, the full-path network access relationship across the entire network security boundary is obtained.

在相关技术中,通过在服务器上设置代理程序,通过代理程序向中央监控服务器上报服务器的网络访问信息,以获取服务器的局部网络访问关系;或者,部署网络流量探针,通过网络流量探针捕获流量数据包,通过网络流量分析设备对数据包进行解析得到网络会话数据后再进行聚合处理后得到穿越网络边界的网络访问关系。然而,通过代理程序采集的网络访问关系中混合了内网内部互访的访问关系,需要结合另外的数据库,如配置管理数据(Configuration Management Database,CMDB)进行筛选才能够识别出穿越网络边界的网络访问关系;而由于数据中心每天会产生大量跨边界业务流量,解析网络流量探针捕获的流量数据包以获得穿越网络边界的网络访问关系的方法对CPU的存储和配置具有较高的要求,因此,存在只能获取到穿越网络边界的局部网络访问关系和方法繁琐,以及成本高昂等问题。为了解决该问题,本申请实施例中提供了相关的解决方案,以下详细说明。In related technologies, by setting up an agent program on the server, the agent program reports the server's network access information to the central monitoring server to obtain the server's local network access relationship; or, deploy a network traffic probe to capture The flow data packet is analyzed by the network flow analysis device to obtain the network session data, and then aggregated to obtain the network access relationship across the network boundary. However, the network access relationship collected by the proxy program is mixed with the access relationship of intranet and internal mutual access, and it needs to be screened in combination with another database, such as Configuration Management Database (CMDB) to identify the network that crosses the network boundary. Access relationship; and because the data center generates a large amount of cross-boundary business traffic every day, the method of analyzing the traffic data packets captured by the network traffic probe to obtain the network access relationship across the network boundary has high requirements for CPU storage and configuration, so , there are problems such as only obtaining local network access relationships across network boundaries and the methods are cumbersome and costly. In order to solve this problem, a related solution is provided in the embodiment of the present application, which will be described in detail below.

根据本申请实施例,提供了一种获取全路径网络访问关系的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to the embodiment of the present application, an embodiment of a method for obtaining a full-path network access relationship is provided. It should be noted that the steps shown in the flow chart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions , and, although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that shown or described herein.

图1是根据本申请实施例提供的一种获取全路径网络访问关系的方法的流程图,如图1所示,该方法包括如下步骤:Fig. 1 is a flowchart of a method for obtaining a full-path network access relationship according to an embodiment of the present application. As shown in Fig. 1, the method includes the following steps:

步骤S102,获取与多个NAT设备中每个NAT设备对应的结构化会话日志。Step S102, acquiring a structured session log corresponding to each NAT device in the multiple NAT devices.

本申请提供的方法是在获取NAT设备的会话日志的基础上实现的,因此,在步骤S102中首先获取网络边界中每个NAT设备的结构化会话日志,而由于网络边界中通常存在不同类型的多个NAT设备,设备类型不同,采集到的日志的格式也不同,并且最初采集到的日志通常是一大串无规则的字符;因此,在获取每个NAT设备的结构化会话日志时,首先需要识别每个NAT设备提供的日志接口的接口协议,具体的,接口协议可以是系统日志协议(syslog)、文件传输协议(File Transfer Protocol,FTP)、安全文件传输协议(SecretFile Transfer Protocol,SFTP)、超文本传输协议(HyperText Transfer Protocol,HTTP)等多种类型的协议,依据接口协议采集每个NAT设备的会话日志,例如,如果NAT设备提供的日志接口使用的是系统日志协议(syslog),则通过syslog获取NAT设备的会话日志;然后将其转换为标准形式的结构化会话日志。The method provided by the present application is realized on the basis of obtaining the session log of the NAT device. Therefore, in step S102, first obtain the structured session log of each NAT device in the network boundary, and because there are usually different types of session logs in the network boundary Multiple NAT devices, different device types, the format of the collected logs is also different, and the logs collected initially are usually a large string of irregular characters; therefore, when obtaining the structured session logs of each NAT device, you first need to Identify the interface protocol of the log interface provided by each NAT device. Specifically, the interface protocol can be a system log protocol (syslog), a file transfer protocol (File Transfer Protocol, FTP), a secure file transfer protocol (SecretFile Transfer Protocol, SFTP), Hypertext Transfer Protocol (HyperText Transfer Protocol, HTTP) and other types of protocols collect session logs of each NAT device according to the interface protocol. For example, if the log interface provided by the NAT device uses the syslog protocol (syslog), then Get session logs of NAT devices through syslog; then convert them into structured session logs in standard form.

根据本申请一个可选的实施例,获取与多个NAT设备中每个NAT设备对应的结构化会话日志,包括以下步骤:获取多个NAT设备的多个日志,从多个日志中获取关键要素信息,其中,关键要素信息包括以下至少之一:时间戳、源网络地址、目的网络地址、目的端口、源映射网络地址、目的映射网络地址、目的映射端口、协议类型、源接口和目的接口;获取每个NAT设备的标识信息,其中,标识信息包括以下至少之一:NAT设备的名称和NAT设备的网络地址;将每个NAT设备的关键要素信息和每个NAT设备的标识信息进行组合,得到每个NAT设备对应的结构化会话日志。According to an optional embodiment of the present application, obtaining a structured session log corresponding to each NAT device in a plurality of NAT devices includes the following steps: obtaining a plurality of logs of a plurality of NAT devices, and obtaining key elements from the plurality of logs Information, wherein the key element information includes at least one of the following: timestamp, source network address, destination network address, destination port, source-mapped network address, destination-mapped network address, destination-mapped port, protocol type, source interface, and destination interface; Acquiring the identification information of each NAT device, wherein the identification information includes at least one of the following: the name of the NAT device and the network address of the NAT device; combining the key element information of each NAT device with the identification information of each NAT device, Get the structured session log corresponding to each NAT device.

在本实施例中,将采集到的日志转换为标准形式的结构化会话日志的方法如下:对采集到的日志进行解析,从每条日志中提取由时间戳、来自客户端侧的数据包进入NAT设备之前的IP包报文中源地址字段的IP值(即源网络地址,源IP)、来自客户端侧的数据包穿越NAT设备之后IP包报文中的目的地址字段的IP值(即目的网络地址,目的IP)、来自客户端侧的数据包穿越NAT设备之后IP包报文中的目的端口字段的端口值(即目的端口)、来自客户端侧的数据包穿越NAT设备出来后的IP包报文中源地址字段的IP值(即源映射网络地址,源映射IP)、来自客户端侧的数据包进入NAT设备之前IP包报文中目的地址字段的IP值(即目的映射网络地址,目的IP)、来自客户端侧的数据包进入NAT设备之前的IP包报文中目的端口字段的端口值(即目的映射端口),获取日志对应的网络会话采用的协议、数据包进入NAT设备通过的接口(即源接口),以及数据包从NAT设备出来通过的接口(即目的接口)等组成的关键要素信息;同时,在采集的日志中提取NAT设备的名称或者NAT设备的IP地址等能够标识NAT设备身份的标识信息;将NAT设备的名称或NAT设备的IP地址标识与NAT设备的名称/IP地址指示的NAT设备的源IP、目的IP、目的端口、源映射IP、目的IP、目的映射端口、源接口和目的接口等关键要素信息进行组合,生成每个NAT设备的结构化会话日志。例如,按照第一字段为NAT设备名称、第二字段为源IP、第三字段为目的IP、第四字段为目的端口、第五字段为协议类型、第六字段为源映射IP、第七字段为目的映射IP、第八字段为目的映射端口、第九字段为源接口、第十字段为目的接口的顺序进行组合,得到每个NAT设备的结构化会话日志。In this embodiment, the method for converting the collected log into a structured session log in a standard form is as follows: analyze the collected log, and extract from each log entry by time stamp, data packet from the client side The IP value of the source address field in the IP packet message before the NAT device (i.e. source network address, source IP), the IP value of the destination address field in the IP packet message after the data packet from the client side passes through the NAT device (i.e. Destination network address, destination IP), the port value of the destination port field in the IP packet after the data packet from the client side traverses the NAT device (that is, the destination port), and the data packet from the client side after passing through the NAT device The IP value of the source address field in the IP packet message (that is, the source mapping network address, source mapping IP), the IP value of the destination address field in the IP packet message before the data packet from the client side enters the NAT device (that is, the destination mapping network address) Address, destination IP), the port value of the destination port field in the IP packet message before the data packet from the client side enters the NAT device (that is, the destination mapping port), the protocol used by the network session corresponding to the log, and the data packet entering the NAT The interface through which the device passes (that is, the source interface), and the interface through which the data packet passes through the NAT device (that is, the destination interface) and other key elements; at the same time, the name of the NAT device or the IP address of the NAT device is extracted from the collected logs Identification information that can identify the identity of the NAT device; identify the name of the NAT device or the IP address of the NAT device with the source IP, destination IP, destination port, source mapping IP, and destination IP of the NAT device indicated by the name/IP address of the NAT device , Destination mapping port, source interface and destination interface and other key elements are combined to generate a structured session log for each NAT device. For example, the first field is the NAT device name, the second field is the source IP, the third field is the destination IP, the fourth field is the destination port, the fifth field is the protocol type, the sixth field is the source mapping IP, and the seventh field is The sequence of mapping IP for the destination, the eighth field for the destination mapping port, the ninth field for the source interface, and the tenth field for the destination interface are combined to obtain the structured session log of each NAT device.

步骤S104,根据每个NAT设备对应的结构化会话日志,提取网络会话在每个NAT设备处的局部网络访问关系,其中,网络会话为在每个NAT设备所属的网络边界内的设备和在每个NAT设备所属的网络边界外的设备之间进行的会话。Step S104, according to the structured session log corresponding to each NAT device, extract the local network access relationship of the network session at each NAT device, wherein the network session is a device within the network boundary to which each NAT device belongs and in each Sessions between devices outside the network boundaries to which a NAT device belongs.

在通过步骤S102提供的方法获得每个NAT设备的结构化会话日志之后,在步骤S104中,依据每个NAT设备的结构化会话日志中记载的信息提取得到在每个NAT设备处观测到的网络会话之间的访问关系(即局部网络访问关系),其中,网络会话是发生在NAT设备所属的网络边界内的设备和NAT设备所属的网络边界外的设备之间会话。After the structured session log of each NAT device is obtained through the method provided in step S102, in step S104, the network information observed at each NAT device is extracted according to the information recorded in the structured session log of each NAT device An access relationship between sessions (that is, a local network access relationship), wherein a network session is a session between a device within the network boundary to which the NAT device belongs and a device outside the network boundary to which the NAT device belongs.

根据本申请另一个可选的实施例,根据每个NAT设备对应的结构会话化日志,提取网络会话在每个NAT设备处的局部网络访问关系,包括以下步骤:获取NAT设备的网络边界拓扑关系,根据网络边界拓扑关系生成NAT设备的出入路径表,其中,NAT设备的出入路径表包括:NAT设备的标识信息、NAT设备所在的网络边界的名称、NAT设备的级联层级,经过NAT设备的网络会话的访问方向、入接口的名称和出接口的名称,入接口为网络会话进入NAT设备的接口,出接口为网络会话从NAT设备出来的接口;根据结构化会话日志生成日志汇聚表,并依据NAT设备的出入路径表和日志汇聚表确定经过NAT设备的网络会话的访问方向;根据访问方向提取网络会话在NAT设备处的局部网络访问关系。According to another optional embodiment of the present application, according to the structural session log corresponding to each NAT device, extracting the local network access relationship of the network session at each NAT device includes the following steps: obtaining the network boundary topology relationship of the NAT device , according to the topological relationship of the network boundary, the ingress and egress path table of the NAT device is generated, wherein the ingress and egress path table of the NAT device includes: the identification information of the NAT device, the name of the network boundary where the NAT device is located, the cascading level of the NAT device, and the The access direction of the network session, the name of the incoming interface and the name of the outgoing interface. The incoming interface is the interface through which the network session enters the NAT device, and the outgoing interface is the interface through which the network session exits the NAT device; generate a log aggregation table based on the structured session log, and Determine the access direction of the network session passing through the NAT device according to the in-out path table and the log aggregation table of the NAT device; extract the local network access relationship of the network session at the NAT device according to the access direction.

在本实施例中,通过以下步骤从每个NAT设备的结构化会话日志中记载的信息提取得到在每个NAT设备处的局部网络访问关系:首先,以在步骤S102中获取的每个NAT设备的结构化会话日志为基础生成日志汇聚表;然后获取记载了NAT设备的名称/IP地址(即NAT设备的标识信息)、NAT设备所在的网络边界的名称、NAT设备的级联层级、网络会话经过NAT设备的访问方向、网络会话进入NAT设备的接口(即入接口)的名称和网络会话从NAT设备中出来的接口(即出接口)的名称等信息的NAT设备所属网络边界的网络边界拓扑图,根据网络边界拓扑图和日志汇聚表确定网络访问NAT设备的方向,即确定是从外部网络→NAT设备→内部网络的访问方向,还是从内部网络→NAT设备→外部网络的访问方向;最后,依据确定好的访问方向提取网络会话在每个NAT设备处的局部网络访问关系。In this embodiment, the local network access relationship at each NAT device is obtained by extracting the information recorded in the structured session log of each NAT device through the following steps: First, with each NAT device acquired in step S102 Generate a log aggregation table based on the structured session log of the NAT device; then obtain the name/IP address of the NAT device (that is, the identification information of the NAT device), the name of the network boundary where the NAT device is located, the cascading level of the NAT device, and the network session The network boundary topology of the network boundary to which the NAT device belongs through information such as the access direction of the NAT device, the name of the interface through which the network session enters the NAT device (ie, the inbound interface), and the name of the interface through which the network session exits the NAT device (ie, the outbound interface) Figure, according to the network boundary topology diagram and the log aggregation table to determine the direction of network access to the NAT device, that is, to determine whether the access direction is from the external network→NAT device→internal network, or from the internal network→NAT device→external network; finally , extracting the local network access relationship of the network session at each NAT device according to the determined access direction.

根据本申请一些优选的实施例,根据结构化会话日志生成日志汇聚表,包括:确定预设周期,并采集在预设周期内的多个结构化会话日志;将多个结构化会话日志中除时间戳以外的其它关键要素信息完全相同的数据归类为一组数据,得到多组数据;根据多组数据生成日志汇聚表,其中,日志汇聚表包括:NAT设备的标识信息、关键要素信息和每组数据出现的次数。According to some preferred embodiments of the present application, generating the log aggregation table according to the structured session log includes: determining a preset period, and collecting multiple structured session logs within the preset period; Data with the same key element information other than the time stamp is classified into one set of data to obtain multiple sets of data; a log aggregation table is generated based on the multiple sets of data, where the log aggregation table includes: identification information of the NAT device, key element information and The number of occurrences of each data set.

在一些优选的实施例中,根据结构化会话日志生成日志汇聚表的方法如下:由于NAT设备每次建立会话都会产生一条日志,因此,在本申请实施例中在实时采集NAT设备的日志时会得到大量的数据,而这大量的数据中又包括多条除时间戳以外完全相同的数据,因此,在一些优选的实施例中,预先设置处理周期(即预设周期),如一小时、一天或者一个月,在处理周期内采集结构化会话日志,对处理周期内的日志进行聚合,具体的,将NAT设备的名称/IP地址、源IP、目的IP、目的端口、和协议类型等关键要素信息完全相同的结构化会话日志聚合为一组数据,将通过以上方法聚合得到的多组数据保存生成日志汇聚表。图2是日志汇聚表的示意图,如图2所示,日志汇聚表的行标识依次为日期、NAT设备、源IP、目的IP、目的端口、协议、源映射IP、目的映射IP、目的映射端口、源接口、目的接口和连接次数(即每组数据出现的次数),其中,日期用于指示日志产生的日期、NAT设备用于指示NAT设备的名称/IP地址,连接次数用于指示在一个处理周期内这组数据出现的次数,如图2所示,在2022年01月01日的某一个处理周期内采集到的数据中,对于设备2-1存在100条源IP为211.0.0.2,目的IP为172.16.0.2,目的端口为8080,协议类型为传输控制协议(Transmission Control Protocol,TCP),源映射IP为211.0.0.2,目的映射IP为112.0.0.2,目的映射端口为80,源接口为extranet,目的接口为inside的日志,则将上述形式的日志在日志表中具体记录一次,然后在该条日志后边标注出其出现的次数;另外,在一个处理周期中出现了多少种不同的日志,在日志汇聚表中就记录几组数据,也就是说分组的数量与日志的种类相同,其中,NAT设备的名称/IP地址、源IP、目的IP、目的端口和协议类型中任意一种数据不同,即为日志种类不同。In some preferred embodiments, the method of generating the log aggregation table according to the structured session log is as follows: Since the NAT device will generate a log every time a session is established, in the embodiment of the present application, when collecting the log of the NAT device in real time, it will A large amount of data is obtained, and the large amount of data includes multiple pieces of identical data except for the time stamp. Therefore, in some preferred embodiments, the processing cycle (ie, the preset cycle) is preset, such as one hour, one day or One month, collect structured session logs during the processing period, and aggregate the logs within the processing period. Specifically, key elements such as the name/IP address of the NAT device, source IP, destination IP, destination port, and protocol type The identical structured session logs are aggregated into a set of data, and multiple sets of data aggregated through the above methods are saved to generate a log aggregation table. Figure 2 is a schematic diagram of the log aggregation table. As shown in Figure 2, the row identifiers of the log aggregation table are date, NAT device, source IP, destination IP, destination port, protocol, source mapping IP, destination mapping IP, and destination mapping port , source interface, destination interface, and connection times (that is, the number of occurrences of each set of data), where the date is used to indicate the date when the log was generated, the NAT device is used to indicate the name/IP address of the NAT device, and the number of connections is used to indicate when a The number of occurrences of this group of data in the processing cycle, as shown in Figure 2, among the data collected in a certain processing cycle on January 1, 2022, there are 100 pieces of source IP 211.0.0.2 for device 2-1, The destination IP is 172.16.0.2, the destination port is 8080, the protocol type is Transmission Control Protocol (TCP), the source mapping IP is 211.0.0.2, the destination mapping IP is 112.0.0.2, the destination mapping port is 80, the source interface If the log is extranet and the destination interface is inside, record the log in the above form once in the log table, and then mark the number of occurrences behind the log; in addition, how many different types of logs appear in a processing cycle For logs, several groups of data are recorded in the log aggregation table, that is to say, the number of groups is the same as the type of logs, among which, any one of the name/IP address, source IP, destination IP, destination port and protocol type of the NAT device Different data means different types of logs.

需要说明的是,如果源IP和源映射IP相同,表示NAT设备未对源IP字段进行转换;如果目的IP和目的映射IP相同,表示NAT设备未对目的IP字段进行转换;如果目的端口和目的映射端口相同,表示NAT设备未对目的的端口字段进行转换。It should be noted that if the source IP and the source mapping IP are the same, it means that the NAT device has not converted the source IP field; if the destination IP and the destination mapping IP are the same, it means that the NAT device has not converted the destination IP field; if the destination port and the destination The mapped ports are the same, indicating that the NAT device has not translated the destination port field.

根据本申请一个可选的实施例,根据结构化会话日志生成日志汇聚表,并依据NAT设备的出入路径表和日志汇聚表确定经过NAT设备的网络会话的访问方向,包括:获取日志汇聚表中的NAT设备的标识信息、与NAT设备的标识信息对应的源接口的名称以及与NAT设备的标识信息对应的目的接口的名称;利用NAT设备的标识信息、与NAT设备的标识信息对应的源接口的名称和与NAT设备的标识信息对应的目的接口的名称通过NAT设备的出入路径表确定经过NAT设备的标识信息指示的NAT设备的网络会话的访问方向。According to an optional embodiment of the present application, the log aggregation table is generated according to the structured session log, and the access direction of the network session passing through the NAT device is determined according to the in-out path table and the log aggregation table of the NAT device, including: obtaining the log aggregation table The identification information of the NAT device, the name of the source interface corresponding to the identification information of the NAT device, and the name of the destination interface corresponding to the identification information of the NAT device; using the identification information of the NAT device, the source interface corresponding to the identification information of the NAT device and the name of the destination interface corresponding to the identification information of the NAT device determines the access direction of the network session passing through the NAT device indicated by the identification information of the NAT device through the ingress and egress path table of the NAT device.

图3是网络边界拓扑图的示意图,如图3所示,以拓扑图的形式记载了网络会话经过NAT设备的路径,网络边界拓扑图中包括:NAT设备所在的网络边界的名称,NAT设备所在的网络边界中每个NAT设备的名称,每个NAT设备的级联层级,每个NAT设备的入接口的名称和出接口的名称,访问NAT设备所在的网络边界的网络的名称,以及穿过NAT设备所在的网络边界后到达的网络的名称,如图3,网络边界的名称为网络边界1,网络边界1中包括设备2-1和设备2-2,其中,设备2-1中的“-1”表示该NAT设备的级联层级为1,同理,设备2-2中的“-2”表示该NAT设备的级联层级为2;当从外部网络1访问内部网络2和/或内部网络3时,设备2-1的入接口为extranet、出接口为inside,设备2-2的入接口为outside、出接口为dmz和intranet,在确定访问方向时,根据日志汇聚表中记录的每组日志的NAT设备、源接口和目的接口这三个字段的值综合查询该组日志对应的网络会话的访问方向。例如,日志汇聚表中记录的一组日志中NAT设备字段的值为设备2-1,源接口字段的值为extranet,目的接口字段的值为inside,则如果在图3所示的网络边界拓扑图中可以查询到网络边界1中存在名称为设备2-1且入口字段的值为extranet,且出接口字段的值为inside的NAT设备,那么可以确定这组日志中记录的NAT设备与网络拓扑图中的NAT设备为同一个NAT设备,并且从网络边界拓扑图中可以确定从接口extranet到接口inside为从外部网络向内部网络访问,即可以确定网络会话在NAT设备2-1的访问方向为入界。相反的,如果日志汇聚表中记录的另一组日志中NAT设备字段的值为设备2-2,源接口字段的值为intranet,目的接口字段的值为outside,则如果在图3所示的网络边界拓扑图中可以查询到网络边界1中存在名称为设备2-2,且入接口字段的值为intranet,且出接口字段的值为outside的NAT设备,那么可以确定这组日志中记录的NAT设备与网络拓扑图中的设备为同一个NAT设备,并且从网络边界拓扑图中可以确定从接口intranet到接口outside为从内部网络访问外部网络,即可以确定网络会话在NAT设备2-2的访问方向为出界。Figure 3 is a schematic diagram of a network boundary topology diagram. As shown in Figure 3, the path of a network session passing through a NAT device is recorded in the form of a topology diagram. The network boundary topology diagram includes: the name of the network boundary where the NAT device is located, the name of the NAT device where the The name of each NAT device in the network boundary, the cascading level of each NAT device, the name of the incoming interface and the name of the outgoing interface of each NAT device, the name of the network accessing the network boundary where the NAT device is located, and the The name of the network reached after the network boundary where the NAT device is located, as shown in Figure 3, the name of the network boundary is network boundary 1, and network boundary 1 includes device 2-1 and device 2-2, wherein, " in device 2-1 -1" indicates that the cascading level of the NAT device is 1. Similarly, "-2" in device 2-2 indicates that the cascading level of the NAT device is 2; when accessing internal network 2 and/or In internal network 3, the incoming interface of device 2-1 is extranet and the outgoing interface is inside, the incoming interface of device 2-2 is outside, and the outgoing interface is dmz and intranet. When determining the access direction, according to the records recorded in the log aggregation table The values of the three fields of NAT device, source interface, and destination interface in each group of logs comprehensively query the access direction of the network session corresponding to the group of logs. For example, if the value of the NAT device field in a group of logs recorded in the log aggregation table is device 2-1, the value of the source interface field is extranet, and the value of the destination interface field is inside, then if the network boundary topology shown in Figure 3 In the figure, it can be found that there is a NAT device named device 2-1 in network boundary 1, the value of the entry field is extranet, and the value of the outbound interface field is inside, then the NAT device and network topology recorded in this group of logs can be determined The NAT device in the figure is the same NAT device, and from the network boundary topology diagram, it can be determined that the access from the interface extranet to the interface inside is from the external network to the internal network, that is, it can be determined that the access direction of the network session on the NAT device 2-1 is Inbound. On the contrary, if the value of the NAT device field in another group of logs recorded in the log aggregation table is device 2-2, the value of the source interface field is intranet, and the value of the destination interface field is outside, then if the In the network boundary topology diagram, it can be found that there is a NAT device named device 2-2 in network boundary 1, and the value of the inbound interface field is intranet, and the value of the outbound interface field is outside, then it can be determined that this group of logs records The NAT device and the device in the network topology diagram are the same NAT device, and from the network boundary topology diagram, it can be determined that from the interface intranet to the interface outside is accessing the external network from the internal network, that is, it can be determined that the network session is on the NAT device 2-2 The access direction is out of bounds.

需要说明的是进行数据处理的服务器在获取到网络边界拓扑关系后以图4所示的表格的形式进行存储,图4是NAT设备的出入路径表,该表格中记载的内容与图3中记载的信息完全相同,例如记载了NAT设备所在的网络边界的名称,该网络边界的级联层级,NAT设备所在的网络边界中每个NAT设备的名称,每个NAT设备的级联层级,网络会话穿过NAT设备的访问方向,网络会话进入NAT设备的接口(即入接口)以及网络会话从NAT设备中出来的接口(即出接口)。如图4所示,当图3中记载的是上述信息时,图4中也对应记载了包含2个NAT设备的网络边界1中,从外部网络1通过网络边界1访问内部网络2时访问方向为入界,级联层级为1的设备2-1的入接口为extranet,出接口为inside,级联层级为2的设备2-2的入接口为outside,出接口为dmz;从内部网络2通过网络边界1访问外部网络1时访问方向为出界,级联层级为1的设备2-1的入接口为inside,出接口为extranet,级联层级为2的设备2-2的入接口为dmz,出接口为outside;从内部网络3通过网络边界1访问外部网络1时访问方向为出界,级联层级为1的设备2-1的入接口为inside,出接口为extranet,级联层级为2的设备2-2的入接口为intranet,出接口为outside。网络边界拓扑关系只需初始化一次便可保存重复使用,只有当检测到网络边界中的NAT设备拓扑发生变化时才进行更新。It should be noted that after obtaining the topological relationship of the network boundary, the server performing data processing stores it in the form of the table shown in Figure 4. Figure 4 is the entry and exit route table of the NAT device, and the content recorded in this table is the same as that recorded in Figure 3 The information is exactly the same, for example, it records the name of the network boundary where the NAT device is located, the cascading level of the network boundary, the name of each NAT device in the network boundary where the NAT device is located, the cascading level of each NAT device, and the network session Through the access direction of the NAT device, the interface through which the network session enters the NAT device (ie, the inbound interface) and the interface through which the network session exits the NAT device (ie, the outbound interface). As shown in Figure 4, when the above information is recorded in Figure 3, it also correspondingly records the access direction when accessing the internal network 2 from the external network 1 through the network boundary 1 in the network boundary 1 including two NAT devices The inbound interface of device 2-1 with cascade level 1 is extranet, and the outbound interface is inside; the inbound interface of device 2-2 with cascade level 2 is outside, and the outbound interface is dmz; from internal network 2 When accessing external network 1 through network boundary 1, the access direction is outbound, the inbound interface of device 2-1 with cascade level 1 is inside, the outbound interface is extranet, and the inbound interface of device 2-2 with cascade level 2 is dmz , the outbound interface is outside; when accessing external network 1 from internal network 3 through network boundary 1, the access direction is outbound, the inbound interface of device 2-1 with cascading level 1 is inside, the outbound interface is extranet, and the cascading level is 2 The incoming interface of device 2-2 is intranet, and the outgoing interface is outside. The topology relationship of the network boundary only needs to be initialized once and can be saved for repeated use. It is only updated when the topology of the NAT device in the network boundary is detected to change.

根据本申请另一个可选的实施例,根据访问方向提取网络会话在NAT设备处的局部网络访问关系,包括:如果访问方向为入界,将与NAT设备的标识信息对应的源映射网络地址确定为内接口源网络地址,将与NAT设备的标识信息对应的目的网络地址确定为内接口目的网络地址,将与NAT设备的标识信息对应的目的端口确定为内接口目的端口,将与NAT设备的标识信息对应的源网络地址确定为外接口源网络地址,将与NAT设备的标识信息对应的目的映射网络地址确定为外接口目的网络地址,并将与NAT设备的标识信息对应的目的映射端口确定为外接口目的端口,其中,入界指示从网络边界外的设备访问网络边界内的设备;根据内接口源网络地址、内接口目的网络地址、内接口端口、外接口源网络地址、外接口目的网络地址和外接口目的端口确定NAT设备访问方向为入界时网络会话在NAT设备处的多个局部网络访问关系;如果访问方向为出界,将与NAT设备的标识信息对应的源网络地址确定为内接口源网络地址、将与NAT设备的标识信息对应的目的映射网络地址确定为内接口目的网络地址、将与NAT设备的标识信息对应的目的映射端口确定为内接口目的端口、将与NAT设备的标识信息对应的源映射网络地址确定为外接口源网络地址、将与NAT设备的标识信息对应的目的网络地址确定为外接口目的网络地址,并将与NAT设备的标识信息对应的目的端口确定为外接口目的端口,其中,出界指示从网络边界内的设备访问网络边界外的设备;根据内接口源网络地址、内接口目的网络地址、内接口目的端口、外接口源网络地址、外接口目的网络地址和外接口目的端口确定访问方向为出界时网络会话在NAT设备处的多个局部网络访问关系。According to another optional embodiment of the present application, extracting the local network access relationship of the network session at the NAT device according to the access direction includes: if the access direction is inbound, determining the source mapping network address corresponding to the identification information of the NAT device is the source network address of the internal interface, the destination network address corresponding to the identification information of the NAT device is determined as the destination network address of the internal interface, the destination port corresponding to the identification information of the NAT device is determined as the destination port of the internal interface, and the The source network address corresponding to the identification information is determined as the source network address of the external interface, the destination mapping network address corresponding to the identification information of the NAT device is determined as the destination network address of the external interface, and the destination mapping port corresponding to the identification information of the NAT device is determined It is the destination port of the external interface, where the inbound indicates accessing the device within the network boundary from the device outside the network boundary; according to the source network address of the internal interface, the destination network address of the internal interface, the port of the internal interface, the source network address of the external interface, and the destination of the external interface The network address and the external interface destination port determine the multiple local network access relationships of the network session at the NAT device when the NAT device access direction is inbound; if the access direction is outbound, the source network address corresponding to the identification information of the NAT device is determined as The internal interface source network address, the destination mapping network address corresponding to the identification information of the NAT device is determined as the internal interface destination network address, the destination mapping port corresponding to the identification information of the NAT device is determined as the internal interface destination port, and the NAT device Determine the source mapping network address corresponding to the identification information of the external interface as the source network address of the external interface, determine the destination network address corresponding to the identification information of the NAT device as the destination network address of the external interface, and determine the destination port corresponding to the identification information of the NAT device is the destination port of the external interface, where out-of-boundary indicates accessing the device outside the network boundary from the device inside the network boundary; according to the source network address of the internal interface, the destination network address of the internal interface, the destination port of the internal interface, the source network address of the external interface, and the destination The network address and the destination port of the external interface determine the multiple local network access relationships of the network session at the NAT device when the access direction is out of bounds.

在本实施例中,在通过上述实施例确定了NAT设备的访问方向之后,根据访问方向提取NAT设备的局部网络访问关系的方法如下:当访问方向为入界时,将NAT设备的日志中记录的源映射IP字段的值确定为NAT设备靠近内部网络侧的接口(即内接口)的网络地址(即内接口源网络地址),将NAT设备的日志中记录的目的IP字段的值确定为NAT设备的内接口目的网络地址,将NAT设备的日志中记录的目的端口字段的值确定为NAT设备的内接口目的端口,将NAT设备的日志中记录的源IP字段的值确定为NAT设备靠近外部网络侧的接口(即外接口)的网络地址(即外接口源网络地址),将NAT设备的日志中记录的目的映射IP字段的值确定为NAT设备的外接口目的网络地址,并将NAT设备的日志中记录的目的映射端口确定为NAT设备的外接口目的端口。当访问方向为出界时,将NAT设备的日志中记录的源IP字段的值确定为NAT设备靠近内部网络侧的接口(即内接口)的网络地址(即内接口源网络地址),将NAT设备的日志中记录的目的映射IP字段的值确定为NAT设备的内接口目的网络地址,将NAT设备的日志中记录的目的映射端口字段的值确定为NAT设备的内接口目的端口,将NAT设备的日志中记录的源映射IP字段的值确定为NAT设备靠近外部网络侧的接口(即外接口)的网络地址(即外接口源网络地址),将NAT设备的日志中记录的目的IP字段的值确定为NAT设备的外接口目的网络地址,并将NAT设备的日志中记录的目的端口确定为NAT设备的外接口目的端口。因此,可以根据访问方向为入界还是出界确定NAT设备的内接口源网络地址、内接口目的网络地址、内接口目的端口、外接口源网络地址、外接口目的网络地址和外接口目的端口,并进一步确定由内接口源网络地址、内接口目的网络地址、内接口目的端口、外接口源网络地址、外接口目的网络地址、和外接口目的端口组成的网络会话在NAT设备处的局部网络访问关系,其中,如果网络边界中仅存在一个NAT设备,则通过该方法应得到一个NAT设备的两个局部网络访问关系,一个是从外部网络到NAT设备的外接口的局部网络访问关系,另一个是从NAT设备的内接口到内部网络的局部网络访问关系;如果网络边界中存在多个NAT设备,则对于每一个NAT设备都应得到两个局部网络访问关系。例如,图2中设备2-1的源IP为211.0.0.2,目的IP为172.16.0.2,目的端口为8080,源映射IP为211.0.0.2,目的映射IP为112.0.0.2,目的映射端口为80,结合图3可以确定从外部网络1访问内部网络2时访问方向为入界,则访问方向为入界时,网络会话在设备2-1处存在以下两段局部网络访问关系,其中,一段是由外接口源网络地址为211.0.0.2,外接口目的网络地址为112.0.0.2,外接口目的端口为80组成的从外部网络1到NAT设备2-1的外接口的局部网络访问关系;另一段是由内接口源网络地址为211.0.0.2,内接口目的网络地址为172.16.0.2,内接口目的端口为8080组成的从NAT设备2-1的内接口到NAT设备2-2的内接口的局部网络访问关系。In this embodiment, after the access direction of the NAT device is determined by the above-mentioned embodiment, the method of extracting the local network access relationship of the NAT device according to the access direction is as follows: when the access direction is inbound, record the log in the NAT device The value of the source mapping IP field of the NAT device is determined as the network address (that is, the source network address of the internal interface) of the interface (that is, the internal interface) close to the internal network side of the NAT device, and the value of the destination IP field recorded in the log of the NAT device is determined as NAT The destination network address of the internal interface of the device, the value of the destination port field recorded in the log of the NAT device is determined as the destination port of the internal interface of the NAT device, and the value of the source IP field recorded in the log of the NAT device is determined as the NAT device is close to the outside The network address of the interface on the network side (i.e. the external interface) (i.e. the source network address of the external interface), the value of the destination mapping IP field recorded in the log of the NAT device is determined as the destination network address of the external interface of the NAT device, and the NAT device The destination mapping port recorded in the log is determined to be the destination port of the external interface of the NAT device. When the access direction is out of bounds, the value of the source IP field recorded in the log of the NAT device is determined to be the network address (i.e. the source network address of the internal interface) of the interface (i.e. the internal interface) of the NAT device close to the internal network side, and the NAT device The value of the destination mapping IP field recorded in the log of the NAT device is determined as the destination network address of the internal interface of the NAT device, and the value of the destination mapping port field recorded in the log of the NAT device is determined as the destination port of the internal interface of the NAT device. The value of the source mapping IP field recorded in the log is determined as the network address (ie, the source network address of the external interface) of the interface (ie, the external interface) of the NAT device close to the external network side, and the value of the destination IP field recorded in the log of the NAT device Determine the destination network address of the external interface of the NAT device, and determine the destination port recorded in the log of the NAT device as the destination port of the external interface of the NAT device. Therefore, the internal interface source network address, the internal interface destination network address, the internal interface destination port, the external interface source network address, the external interface destination network address, and the external interface destination port of the NAT device can be determined according to whether the access direction is inbound or outbound, and Further determine the local network access relationship at the NAT device of the network session consisting of the source network address of the internal interface, the destination network address of the internal interface, the destination port of the internal interface, the source network address of the external interface, the destination network address of the external interface, and the destination port of the external interface , where, if there is only one NAT device in the network boundary, two local network access relationships of a NAT device should be obtained by this method, one is the local network access relationship from the external network to the external interface of the NAT device, and the other is The local network access relationship from the internal interface of the NAT device to the internal network; if there are multiple NAT devices in the network boundary, two local network access relationships should be obtained for each NAT device. For example, the source IP of device 2-1 in Figure 2 is 211.0.0.2, the destination IP is 172.16.0.2, the destination port is 8080, the source mapping IP is 211.0.0.2, the destination mapping IP is 112.0.0.2, and the destination mapping port is 80 , combined with Figure 3, it can be determined that when accessing the internal network 2 from the external network 1, the access direction is inbound, then when the access direction is inbound, the network session has the following two sections of local network access relationships at the device 2-1, where one section is The local network access relationship from the external network 1 to the external interface of the NAT device 2-1 composed of the source network address of the external interface is 211.0.0.2, the destination network address of the external interface is 112.0.0.2, and the destination port of the external interface is 80; The part from the internal interface of NAT device 2-1 to the internal interface of NAT device 2-2 is composed of internal interface source network address 211.0.0.2, internal interface destination network address 172.16.0.2, internal interface destination port 8080 network access relationship.

步骤S106,将网络会话在每个NAT设备处的局部网络访问关系进行串联,得到每个NAT设备所属的网络边界的全路径网络访问关系。Step S106, concatenating the partial network access relationship of the network session at each NAT device to obtain the full-path network access relationship of the network boundary to which each NAT device belongs.

在步骤S106中,在通过上述方法确定了NAT设备局部网络访问关系之后,将网络会话在每个NAT设备处的多个局部网络访问关系串联,即可得到该NAT设备所属的网络边界的全路径网络访问关系。In step S106, after the local network access relationship of the NAT device is determined by the above method, multiple local network access relationships of the network session at each NAT device are connected in series to obtain the full path of the network boundary to which the NAT device belongs network access relationship.

根据本申请一个可选的实施例,将每个NAT设备的局部网络访问关系进行串联,得到每个NAT设备所属的网络边界的全路径网络访问关系,包括:从NAT设备的出入路径表中确定NAT设备所属的网络边界中NAT设备的数量;如果数量大于一个,依据串联规则将同一个网络边界内的多个NAT设备的多个局部网络访问关系进行串联,得到全路径网络访问关系;如果数量等于一个,将NAT设备的局部网络访问关系确定为全路径网络访问关系。According to an optional embodiment of the present application, the local network access relationship of each NAT device is connected in series to obtain the full-path network access relationship of the network boundary to which each NAT device belongs, including: determining from the in-out path table of the NAT device The number of NAT devices in the network boundary to which the NAT device belongs; if the number is greater than one, connect multiple local network access relationships of multiple NAT devices in the same network boundary in series according to the concatenation rules to obtain the full-path network access relationship; if the number is equal to one, and the partial network access relationship of the NAT device is determined as the full-path network access relationship.

在本实施例中,在串联每个NAT设备的局部网络访问关系时,首先从图4所示的NAT设备的出入路径表中确定NAT设备所属的网络边界以及NAT设备在该网络边界中的NAT设备的数量,如果网络边界中只存在一个NAT设备,那么这个NAT设备的局部网络访问关系就是该网络边界的全路径网络访问关系;如果网络边界中包括2个及2个以上NAT设备,此时,将网络边界中的多个NAT设备的多个局部网络访问关系进行串联后得到该网络边界的全路径网络访问关系。In this embodiment, when connecting the local network access relationship of each NAT device in series, first determine the network boundary to which the NAT device belongs and the NAT of the NAT device in the network boundary from the ingress and egress path table of the NAT device shown in Figure 4. The number of devices, if there is only one NAT device in the network boundary, then the local network access relationship of this NAT device is the full-path network access relationship of the network boundary; if there are 2 or more NAT devices in the network boundary, then , the full-path network access relationship of the network boundary is obtained by concatenating the multiple partial network access relationships of the multiple NAT devices in the network boundary.

根据本申请另一些优选的实施例,依据串联规则将同一个网络边界内的多个NAT设备的多个局部网络访问关系进行串联,包括:如果多个NAT设备中的第一NAT设备的内接口源网络地址等于多个NAT设备中的第二NAT设备的外接口源网络地址,第一NAT设备的内接口目的网络地址等于第二NAT设备的外接口目的网络地址,且第一NAT设备的内接口目的端口等于第二NAT设备的外接口目的端口,将第一NAT设备的局部网络访问关系和第二NAT设备的局部网络访问关系串联为网络边界的全路径访问关系,其中,第一NAT设备与第二NAT设备为属于同一个网络边界,第一NAT设备与第二NAT设备存在相邻的关系,且第一NAT设备的级联层级小于第二NAT设备的级联层级。According to other preferred embodiments of the present application, the multiple local network access relationships of multiple NAT devices within the same network boundary are connected in series according to the concatenation rules, including: if the internal interface of the first NAT device among the multiple NAT devices The source network address is equal to the source network address of the external interface of the second NAT device among the multiple NAT devices, the destination network address of the internal interface of the first NAT device is equal to the destination network address of the external interface of the second NAT device, and the internal interface of the first NAT device The destination port of the interface is equal to the destination port of the external interface of the second NAT device, and the local network access relationship of the first NAT device and the local network access relationship of the second NAT device are connected in series to form a full-path access relationship of the network boundary, wherein the first NAT device The first NAT device and the second NAT device belong to the same network boundary, and the first NAT device is adjacent to the second NAT device, and the cascading level of the first NAT device is smaller than that of the second NAT device.

在另一些优选的实施例中,通过以下方法将同一网络边界中的多个NAT设备的多个局部网络访问关系进行串联,确定同一网络边界内的多个NAT设备的级联层级,如果低级联层级的NAT设备的局部网络访问关系中记载的内接口源网络地址和与其相邻的高级联层级的NAT设备的局部网络访问关系中记载外接口源网络地址相同,并且该低级联层级NAT设备的局部网络访问关系中记载的内接口目的网络地址和与其相邻的高级联层级的NAT设备的局部网络访问关系中记载的外接口目的网络地址相同,并且该低级联层级NAT设备的局部网络访问关系中记载的内接口目的端口和与其相邻的高级联层级的NAT设备的局部网络访问关系中记载的外接口目的端口相同,则从最低级开始,按照级联层级依次将低级联层级的NAT设备的局部网络访问关系和较高级联层级的NAT设备的局部网络访问关系串联,直至串联到网络边界中级联层级最高的NAT设备,将串联的结果作为该网络边界的全路径网络访问关系。举例来说,网络边界1中包含1级NAT设备2-1和2级NAT设备2-2,NAT设备2-1的内接口源网络地址为211.0.0.2,内接口目的网络地址为172.16.0.2,内接口目的端口为8080,NAT设备2-2的外接口源网络地址为211.0.0.2,外接口目的网络地址为172.16.0.2,外接口目的端口为8080,则将NAT设备2-1的局部网络访问关系和NAT设备2-2的局部网络访问关系串联为网络边界1的全路径网络访问关系。In other preferred embodiments, multiple local network access relationships of multiple NAT devices in the same network boundary are connected in series by the following method, and the cascading levels of multiple NAT devices in the same network boundary are determined. The source network address of the internal interface recorded in the local network access relationship of the hierarchical NAT device is the same as the source network address of the external interface recorded in the local network access relationship of the adjacent higher-level NAT device, and the lower-level NAT device's The destination network address of the internal interface recorded in the local network access relationship is the same as the destination network address of the external interface recorded in the local network access relationship of the adjacent high-level NAT device, and the local network access relationship of the lower-level NAT device The destination port of the internal interface recorded in is the same as the destination port of the external interface recorded in the local network access relationship of the adjacent high-level NAT device, then start from the lowest level and sequentially connect the NAT devices of the lower cascade level The local network access relationship of the local network is connected in series with the local network access relationship of the NAT device at a higher cascading level, until it is connected in series to the NAT device with the highest cascading level in the network boundary, and the result of the series connection is used as the full-path network access relationship of the network boundary. For example, network boundary 1 includes level 1 NAT device 2-1 and level 2 NAT device 2-2, the source network address of the internal interface of NAT device 2-1 is 211.0.0.2, and the destination network address of the internal interface is 172.16.0.2 , the destination port of the internal interface is 8080, the source network address of the external interface of NAT device 2-2 is 211.0.0.2, the destination network address of the external interface is 172.16.0.2, and the destination port of the external interface is 8080, then the local The network access relationship and the local network access relationship of the NAT device 2-2 are connected in series to form the full-path network access relationship of the network boundary 1.

图5是全路径网络访问关系表的示意图,需要说明的是,在得到网络边界的全路径网络访问关系后还可以将其以图5所示的表格的形式记录保存,全路径网络访问关系表记录了网络边界的名称,网络会话访问网络边界的访问方向,最低级联层级的外接口的局部网络访问关系,最高级联层级的内接口的局部网络访问关系,以及相邻NAT设备之间的局部网络访问关系、网络会话采用的协议,和同一全路径网络访问关系出现的次数(即连接次数)其中,最低级联层级的外接口的局部网络访问关系,最高级联层级的内接口的局部网络访问关系,以及相邻NAT设备之间的局部网络访问关系这三种局部网络访问关系均由源IP字段、目的IP字段和目的端口字段组成。如图3所示的网络边界1中包括最低级联层级的NAT设备2-1和最高级联层级的NAT设备2-2,则通过外部网络1访问内部网络2或内部网络3时,在网络边界1的全路径网络访问关系表中,访问方向记录为入界,设备2-1的外接口的局部网络访问关系由源IP211.0.0.2,目的IP112.0.0.2,目的端口80组成,设备2-2的内接口的局部网络访问关系由源IP211.0.0.2,目的IP172.16.0.2,目的端口8080组成,设备2-1和设备2-2之间的局部网络访问关系由源IP211.0.0.2,目的IP172.16.0.2,目的端口8080组成,同时在网络边界1的全路径网络访问关系表中记录该条全路径访问关系出现的次数(例如100次)。当通过内部网络2或内部网络3访问外部网络1时,在网络边界1的全路径网络访问关系表中,访问方向记录为出界,设备2-1的外接口的局部网络访问关系由源IP112.0.10.3,目的IP211.0.0.3,目的端口443组成,设备2-2的内接口的局部网络访问关系由源IP172.16.0.3,目的IP192.168.0.3,目的端口443组成,设备2-1和设备2-2之间的局部网络访问关系由源IP172.16.0.3,目的IP211.0.0.3,目的端口443组成,同时在网络边界1的全路径网络访问关系表中记录该条全路径访问关系出现的次数(例如200次)。Fig. 5 is a schematic diagram of the full-path network access relationship table. It should be noted that after obtaining the full-path network access relationship at the network boundary, it can also be recorded and saved in the form shown in Fig. 5. The full-path network access relationship table Records the name of the network boundary, the access direction of the network session to the network boundary, the local network access relationship of the outer interface of the lowest cascade level, the local network access relationship of the inner interface of the highest cascade level, and the relationship between adjacent NAT devices. The local network access relationship, the protocol used by the network session, and the number of occurrences of the same full-path network access relationship (that is, the number of connections). Among them, the local network access relationship of the external interface at the lowest cascade level, and the local The network access relationship, and the partial network access relationship between adjacent NAT devices, these three partial network access relationships are composed of a source IP field, a destination IP field and a destination port field. As shown in Figure 3, the network boundary 1 includes the NAT device 2-1 of the lowest cascading level and the NAT device 2-2 of the highest cascading level. When accessing the internal network 2 or the internal network 3 through the external network 1, the network In the full-path network access relationship table of boundary 1, the access direction is recorded as inbound, and the local network access relationship of the external interface of device 2-1 is composed of source IP 211.0.0.2, destination IP 112.0.0.2, and destination port 80. The local network access relationship of the internal interface of device 2-2 is composed of source IP 211.0.0.2, destination IP 172.16.0.2, and destination port 8080. The local network access relationship between device 2-1 and device 2-2 is composed of source It consists of IP211.0.0.2, destination IP172.16.0.2, and destination port 8080. At the same time, the number of occurrences of this full-path access relationship (for example, 100 times) is recorded in the full-path network access relationship table of network boundary 1. When accessing external network 1 through internal network 2 or internal network 3, in the full-path network access relationship table of network boundary 1, the access direction is recorded as out of bounds, and the local network access relationship of the external interface of device 2-1 is determined by the source IP112. 0.10.3, destination IP 211.0.0.3, destination port 443, the local network access relationship of the internal interface of device 2-2 is composed of source IP 172.16.0.3, destination IP 192.168.0.3, destination port 443, device 2 The local network access relationship between -1 and device 2-2 is composed of source IP172.16.0.3, destination IP211.0.0.3, and destination port 443. At the same time, this entry is recorded in the full-path network access relationship table of network boundary 1 The number of occurrences of the full path access relationship (for example, 200 times).

通过上述步骤,可以实现通过NAT会话日志提取出经过NAT设备前后的局部网络访问关系,结合网络边界的NAT设备拓扑图将多个局部网络访问关系串联为NAT设备所在的网络边界的全路径网络访问关系;由于是从会话日志中提取网络会话经过网络边界的全路径网络访问关系,而无需以NAT设备的映射配置数据为基础来获取网络会话经过网络边界的全路径网络访问关系,因此,适用于NAT设备中存在一对多映射、多对一映射、关联了策略路由的映射等复杂的NAT配置的应用场景,并适用于存在多台NAT设备级联的应用场景,在无需部署代理程序、无需捕获和解析海量的业务流量数据包的基础上,在降低运维成本的同时准确且高效的获取网络边界的全路径网络访问关系。Through the above steps, the local network access relationship before and after passing through the NAT device can be extracted through the NAT session log, and multiple local network access relationships can be connected in series in combination with the NAT device topology map at the network boundary to form a full-path network access at the network boundary where the NAT device is located. relationship; since the full-path network access relationship of the network session passing through the network boundary is extracted from the session log, it is not necessary to obtain the full-path network access relationship of the network session passing through the network boundary based on the mapping configuration data of the NAT device. Therefore, it is suitable for There are complex NAT configuration application scenarios such as one-to-many mapping, many-to-one mapping, and mapping associated with policy routing in the NAT device, and are applicable to application scenarios where multiple NAT devices are cascaded. On the basis of capturing and analyzing massive business traffic data packets, it can accurately and efficiently obtain the full-path network access relationship of the network boundary while reducing operation and maintenance costs.

根据本申请一个可选的实施例,获取全路径网络访问关系的方法还包括:将全路径网络访问关系中发起访问请求的设备对应的节点确定为开始节点,将全路径网络访问关系中接收访问请求的设备对应的节点确定为结束节点,并将全路径网络访问关系中的NAT设备确定为中间节点;将连接开始节点,中间节点和结束节点的线段确定为边,其中,边的方向根据网络会话穿过网络边界的访问方向确定,边的方向用箭头指示;根据开始节点、中间节点、结束节点和边生成全路径网络访问关系的可视图;展示全路径网络访问关系的可视图。According to an optional embodiment of the present application, the method for obtaining the full-path network access relationship further includes: determining the node corresponding to the device that initiates the access request in the full-path network access relationship as the starting node, and determining the node that receives the access request in the full-path network access relationship The node corresponding to the requested device is determined as the end node, and the NAT device in the full-path network access relationship is determined as the intermediate node; the line segment connecting the start node, the intermediate node and the end node is determined as an edge, where the direction of the edge is determined according to the network The access direction of the session passing through the network boundary is determined, and the direction of the edge is indicated by an arrow; a visual view of the full-path network access relationship is generated according to the start node, intermediate node, end node, and edge; the visual view of the full-path network access relationship is displayed.

根据本申请实施例提供的方法还可以显示全路径网络访问关系,图6是全路径网络访问关系可视图的示意图,如图6所示,全路径网络访问关系可视图包括外部网络区域,网络边界区域和内部网络区域,其中,由内部网络发起网络会话,内部网络区域显示了内部网络中的设备的名称(即客户端)和设备的网络地址(如172.16.0.3)和网络会话从内部网络进入网络边界的局部网络访问关系;网络边界区域中显示了网络边界中每个NAT设备的名称(如NAT设备1、NAT设备2)、源接口(如inside、intranet)和目的接口(如extranet、outside),以及网络会话在网络边界中的NAT设备之间的局部网络访问关系;外部网络区域中显示了外部网络中设备的名称(如服务器)和设备的网络地址(如112.0.10.3:443)和网络会话通过网络边界访问外部网络的局部网络访问关系;其中,外部网络访问网络边界的局部网络访问关系以标签的形式显示,包括源网络地址(如112.00.10.3),目的网络地址(如211.0.10.3)和目的端口(如443);内部网络访问网络边界的局部网络访问关系以标签的形式显示,包括源网络地址(如172.16.0.3),目的网络地址(如192.168.0.3)和目的端口(如443);网络会话在NAT设备之间的局部网络访问关系以标签的形式显示,包括源网络地址(如172.16.0.3),目的网络地址(如211.0.0.3)和目的端口(如443)。在显示访问路径时,以被访问的设备对应的节点作为结束节点,以多个NAT设备对应的多个节点作为多个中间节点,以整个路径中发起访问请求的设备对应的节点作为开始节点,通过线段将访问路径中的设备对应的节点连接起来作为边,通过箭头指示访问方向。According to the method provided in the embodiment of the present application, the full-path network access relationship can also be displayed. FIG. 6 is a schematic diagram of a full-path network access relationship view. As shown in FIG. 6, the full-path network access relationship view includes external network areas and network boundaries. Area and internal network area, wherein, the network session is initiated by the internal network, the internal network area shows the name of the device in the internal network (that is, the client) and the network address of the device (such as 172.16.0.3) and the network session enters from the internal network Local network access relationship at the network boundary; the network boundary area displays the name of each NAT device (such as NAT device 1, NAT device 2), source interface (such as inside, intranet) and destination interface (such as extranet, outside ), and the local network access relationship between the NAT devices in the network boundary of the network session; the external network area shows the name of the device in the external network (such as a server) and the network address of the device (such as 112.0.10.3:443) and The network session accesses the partial network access relationship of the external network through the network boundary; the partial network access relationship of the external network accessing the network boundary is displayed in the form of a label, including the source network address (such as 112.00.10.3), and the destination network address (such as 211.0. 10.3) and destination port (such as 443); the local network access relationship of the internal network access network boundary is displayed in the form of labels, including source network address (such as 172.16.0.3), destination network address (such as 192.168.0.3) and destination port ( Such as 443); the local network access relationship between the network sessions between NAT devices is displayed in the form of labels, including source network address (such as 172.16.0.3), destination network address (such as 211.0.0.3) and destination port (such as 443). When displaying the access path, the node corresponding to the accessed device is used as the end node, multiple nodes corresponding to multiple NAT devices are used as multiple intermediate nodes, and the node corresponding to the device that initiates the access request in the entire path is used as the starting node. The nodes corresponding to the devices in the access path are connected as edges by line segments, and the access direction is indicated by arrows.

图7是根据本申请实施例提供的一种全路径网络访问关系的展示系统的结构图,包括:终端设备70、数据可视化服务器72和数据处理服务器74,其中,终端设备70,与数据可视化服务器72连接,用于向数据可视化服务器72发送用于请求访问网络边界的全路径网络访问关系的查询请求,并展示全路径网络访问关系;数据可视化服务器72,与数据处理服务器74连接,用于响应查询请求并获取与全路径网络访问关系对应的数据;数据处理服务器74,用于获取多个NAT设备的多个日志,将多个日志转换为与多个NAT设备中每个NAT设备对应的结构化会话日志,根据每个NAT设备对应的结构化会话日志,提取网络会话在每个NAT设备处的局部网络访问关系,将在每个NAT设备处的局部网络访问关系进行串联,得到每个NAT设备所属的网络边界的全路径网络访问关系,存储与全路径网络访问关系对应的数据,并向数据可视化服务器72下发与全路径网络访问关系对应的数据,其中,网络会话为在网络边界内的设备和在网络边界外的设备之间进行的会话。FIG. 7 is a structural diagram of a display system for a full-path network access relationship provided according to an embodiment of the present application, including: a terminal device 70, a data visualization server 72, and a data processing server 74, wherein the terminal device 70 and the data visualization server 72 connections, for sending to the data visualization server 72 a query request for requesting access to the full-path network access relationship of the network boundary, and displaying the full-path network access relationship; the data visualization server 72, connected with the data processing server 74, for responding Query request and obtain the data corresponding to the full-path network access relationship; the data processing server 74 is used to obtain multiple logs of multiple NAT devices, and convert the multiple logs into a structure corresponding to each NAT device in the multiple NAT devices According to the structured session log corresponding to each NAT device, the local network access relationship of the network session at each NAT device is extracted, and the local network access relationship at each NAT device is connected in series to obtain each NAT The full-path network access relationship of the network boundary to which the device belongs stores the data corresponding to the full-path network access relationship, and sends the data corresponding to the full-path network access relationship to the data visualization server 72, wherein the network session is within the network boundary Sessions between devices on the network and devices outside the network perimeter.

图8是展示NAT设备所在网络边界的全路径网络访问关系的展示系统的工作流程图,如图8所示终端设备70首先向数据可视化服务器72发起查询请求以查询NAT所在网络边界的全路径网络访问关系,数据可视化服务器72接收到查询请求后,从数据处理服务器74中获取全路径网络访问关系;数据处理服务器74将存储的用于标识全路径网络访问关系的数据下发至数据可视化服务器72,其中,数据处理服务器74在预定的周期中采集的网络边界中每个NAT设备的会话日志并将每条会话日志转换为标准的结构化会话日志,进而通过每个NAT设备的结构化会话日志提取每个NAT设备的局部网络访问关系,将每个NAT设备的局部网络访问关系按照上述的方法串联为这多个NAT设备所在网络边界的全路径网络访问关系并存储;数据可视化服务器72将处理后可以可视化的全路径网络访问关系发送到终端设备70,终端设备70生成表示全路径网络访问关系的可视图,并显示该可视图。Fig. 8 is a working flow chart of the display system showing the full-path network access relationship at the network border where the NAT device is located. As shown in Fig. 8, the terminal device 70 first initiates a query request to the data visualization server 72 to query the full-path network at the network border where the NAT device is located Access relationship, after the data visualization server 72 receives the query request, it obtains the full-path network access relationship from the data processing server 74; the data processing server 74 sends the stored data for identifying the full-path network access relationship to the data visualization server 72 , wherein, the data processing server 74 collects the session log of each NAT device in the network boundary in a predetermined cycle and converts each session log into a standard structured session log, and then passes the structured session log of each NAT device Extract the local network access relationship of each NAT device, connect the local network access relationship of each NAT device in series as the full-path network access relationship of the network boundary where these multiple NAT devices are located and store; the data visualization server 72 will process Afterwards, the visualized full-path network access relationship is sent to the terminal device 70, and the terminal device 70 generates a visual view representing the full-path network access relationship, and displays the visual view.

图9是根据本申请实施例提供的一种获取全路径网络访问关系的装置的结构图,包括:获取模块90,用于获取与多个NAT设备中每个NAT设备对应的结构化会话日志;提取模块92,用于根据每个NAT设备对应的结构化会话日志,提取网络会话在每个NAT设备处的局部网络访问关系,其中,网络会话为在每个NAT设备所属的网络边界内的设备和在每个NAT设备所属的网络边界外的设备之间进行的会话;处理模块94,用于将网络会话在每个NAT设备处的局部网络访问关系进行串联,得到每个NAT设备所属的网络边界的全路径网络访问关系。FIG. 9 is a structural diagram of an apparatus for obtaining a full-path network access relationship according to an embodiment of the present application, including: an obtaining module 90 configured to obtain a structured session log corresponding to each NAT device in a plurality of NAT devices; The extraction module 92 is configured to extract the local network access relationship of the network session at each NAT device according to the structured session log corresponding to each NAT device, wherein the network session is a device within the network boundary to which each NAT device belongs Conversations with devices outside the network boundaries to which each NAT device belongs; processing module 94, configured to connect the local network access relationships of network sessions at each NAT device in series to obtain the network to which each NAT device belongs The full-path network access relationship of the boundary.

在获取全路径网络访问关系的装置工作时,通过获取模块90实时采集和解析网络边界中每个NAT设备的会话日志,将采集到的原始会话日志转化为标准的结构化会话日志;提取模块92获取并存储通过获取模块90得到的结构化会话日志,按照如一小时、一天、一个月的预设周期,将一小时内的数据或者一天内的数据或者一个月内的数据进行汇聚分类并从中提取经过NAT设备前后的局部网络访问关系;通过处理模块94,将通过提取模块92得到的经过NAT设备前后的局部网络访问关系串联为NAT设备所在的网络设备的全路径网络访问关系。When the device for obtaining the full-path network access relationship is working, the acquisition module 90 collects and analyzes the session log of each NAT device in the network boundary in real time, and converts the collected original session log into a standard structured session log; the extraction module 92 Obtain and store the structured session logs obtained through the acquisition module 90, and collect and classify the data within one hour, the data within one day, or the data within one month according to a preset period such as one hour, one day, or one month, and extract them The local network access relationship before and after passing through the NAT device; through the processing module 94, the local network access relationship before and after passing through the NAT device obtained by the extraction module 92 is connected in series as the full-path network access relationship of the network device where the NAT device is located.

需要说明的是,图9所示实施例的优选实施方式可以参见图1所示实施例的相关描述,此处不再赘述。It should be noted that, for preferred implementation manners of the embodiment shown in FIG. 9 , reference may be made to relevant descriptions of the embodiment shown in FIG. 1 , and details are not repeated here.

本实施例提供的方法可以应用在任何部署了NAT设备的网络边界,例如可以应用在数据中心内网与互联网边界,数据中心内部不同业务隔离区边界,公有云与互联网的边界等。通过本申请实施例提供的方法采集网络安全边界NAT设备的NAT会话日志,提取出经过NAT设备前后的局部网络访问关系,对边界网络路径上多个NAT设备节点前后的局部网络访问关系进行串联匹配,从而精准获取安全边界全路径访问关系。在复杂的多NAT设备级联环境中,以及复杂的NAT设备配置环境中,如在NAT设备中存在一对多映射、多对一映射、关联了策略路由(Policy Based Routing,PBR)的地址映射、端口映射等复杂的NAT配置的应用环境中,准确高效的获取网络边界的全路径网络访问关系的同时,无需在大量的业务服务器上部署代理程序,也无需捕获和解析海量的业务流量数据包,降低了运维成本。The method provided in this embodiment can be applied to any network boundary where NAT devices are deployed, for example, it can be applied to the boundary between the intranet of the data center and the Internet, the boundary of different service isolation areas inside the data center, the boundary between the public cloud and the Internet, and the like. Collect the NAT session log of the network security border NAT device through the method provided by the embodiment of the present application, extract the local network access relationship before and after passing through the NAT device, and perform serial matching on the local network access relationship before and after multiple NAT device nodes on the border network path , so as to accurately obtain the full-path access relationship of the security boundary. In a complex multi-NAT device cascading environment, and in a complex NAT device configuration environment, such as one-to-many mapping, many-to-one mapping, and address mapping associated with Policy Based Routing (PBR) in the NAT device In the application environment of complex NAT configurations such as , port mapping, etc., while accurately and efficiently obtaining the full-path network access relationship of the network border, there is no need to deploy agents on a large number of business servers, and there is no need to capture and analyze massive business traffic data packets. , reducing operation and maintenance costs.

本申请实施例还提供了一种非易失性存储介质,该非易失性存储介质中存储有计算机程序,其中,非易失性存储介质所在设备通过运行计算机程序执行以上的全路径网络访问关系的方法。The embodiment of the present application also provides a non-volatile storage medium, in which a computer program is stored, wherein, the device where the non-volatile storage medium is located executes the above full-path network access by running the computer program method of relationship.

上述非易失性存储介质用于存储执行以下功能的程序:获取与多个NAT设备中每个NAT设备对应的结构化会话日志;根据每个NAT设备对应的结构化会话日志,提取网络会话在每个NAT设备处的局部网络访问关系,其中,网络会话为在每个NAT设备所属的网络边界内的设备和在每个NAT设备所属的网络边界外的设备之间进行的会话;将网络会话在每个NAT设备处的局部网络访问关系进行串联,得到每个NAT设备所属的网络边界的全路径网络访问关系。The above-mentioned non-volatile storage medium is used to store the program that performs the following functions: obtain the structured session log corresponding to each NAT device in the plurality of NAT devices; extract the network session according to the structured session log corresponding to each NAT device The local network access relationship at each NAT device, wherein the network session is a session between a device within the network boundary to which each NAT device belongs and a device outside the network boundary to which each NAT device belongs; the network session The local network access relationship at each NAT device is connected in series to obtain the full-path network access relationship of the network boundary to which each NAT device belongs.

本申请实施例还提供了一种电子装置,包括存储器和处理器,存储器中存储有计算机程序,处理器被设置为通过计算机程序执行以上的全路径网络访问关系的方法。The embodiment of the present application also provides an electronic device, which includes a memory and a processor, where a computer program is stored in the memory, and the processor is configured to execute the above method for the full-path network access relationship through the computer program.

上述电子设备中的处理器用于运行执行以下功能的程序:获取与多个NAT设备中每个NAT设备对应的结构化会话日志;根据每个NAT设备对应的结构化会话日志,提取网络会话在每个NAT设备处的局部网络访问关系,其中,网络会话为在每个NAT设备所属的网络边界内的设备和在每个NAT设备所属的网络边界外的设备之间进行的会话;将网络会话在每个NAT设备处的局部网络访问关系进行串联,得到每个NAT设备所属的网络边界的全路径网络访问关系。The processor in the above-mentioned electronic device is configured to run a program that performs the following functions: obtain a structured session log corresponding to each NAT device in a plurality of NAT devices; extract the network session in each A local network access relationship at each NAT device, wherein the network session is a session between a device within the network boundary to which each NAT device belongs and a device outside the network boundary to which each NAT device belongs; The partial network access relationship at each NAT device is connected in series to obtain the full-path network access relationship of the network boundary to which each NAT device belongs.

需要说明的是,上述获取全路径网络访问关系的装置中的各个模块可以是程序模块(例如是实现某种特定功能的程序指令集合),也可以是硬件模块,对于后者,其可以表现为以下形式,但不限于此:上述各个模块的表现形式均为一个处理器,或者,上述各个模块的功能通过一个处理器实现。It should be noted that each module in the above-mentioned device for obtaining the full-path network access relationship may be a program module (for example, a set of program instructions to realize a certain function), or a hardware module. For the latter, it may be expressed as The form is as follows, but not limited thereto: each of the above-mentioned modules is represented by one processor, or the functions of the above-mentioned modules are realized by one processor.

上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.

在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present application, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.

在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed technical content can be realized in other ways. Wherein, the device embodiments described above are only illustrative. For example, the division of the units may be a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or may be Integrate into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of units or modules may be in electrical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。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 may be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of this application or the part that contributes to the related technology or all or 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. Several instructions are included to make a computer device (which may be a personal computer, server or network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes. .

以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above description is only the preferred embodiment of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present application, some improvements and modifications can also be made. These improvements and modifications are also It should be regarded as the protection scope of this application.

Claims (13)

1.一种获取全路径网络访问关系的方法,其特征在于,包括:1. A method for obtaining a full-path network access relationship, comprising: 获取与多个NAT设备中每个NAT设备对应的结构化会话日志;obtaining a structured session log corresponding to each of the plurality of NAT devices; 根据所述每个NAT设备对应的结构化会话日志,提取网络会话在所述每个NAT设备处的局部网络访问关系,其中,所述网络会话为在每个NAT设备所属的网络边界内的设备和在所述每个NAT设备所属的网络边界外的设备之间进行的会话;According to the structured session log corresponding to each NAT device, extract the local network access relationship of the network session at each NAT device, wherein the network session is a device within the network boundary to which each NAT device belongs and sessions performed between devices outside the network boundary to which each NAT device belongs; 将所述网络会话在所述每个NAT设备处的局部网络访问关系进行串联,得到所述每个NAT设备所属的网络边界的全路径网络访问关系。The local network access relationship of the network session at each NAT device is connected in series to obtain the full-path network access relationship of the network boundary to which each NAT device belongs. 2.根据权利要求1所述的方法,其特征在于,根据所述每个NAT设备对应的结构会话化日志,提取网络会话在所述每个NAT设备处的局部网络访问关系,包括:2. The method according to claim 1, wherein, according to the structured session log corresponding to each NAT device, extracting the local network access relationship of the network session at each NAT device, comprising: 获取所述NAT设备的网络边界拓扑关系,根据所述网络边界拓扑关系生成所述NAT设备的出入路径表,其中,所述NAT设备的出入路径表包括:所述NAT设备的标识信息、所述NAT设备所在的网络边界的名称、所述NAT设备的级联层级,经过所述NAT设备的网络会话的访问方向、入接口的名称和出接口的名称,所述入接口为所述网络会话进入所述NAT设备的接口,所述出接口为所述网络会话从所述NAT设备出来的接口;Obtain the network boundary topology relationship of the NAT device, and generate an ingress and egress path table of the NAT device according to the network boundary topology relationship, wherein the ingress and egress path table of the NAT device includes: identification information of the NAT device, the The name of the network boundary where the NAT device is located, the cascading level of the NAT device, the access direction of the network session passing through the NAT device, the name of the incoming interface and the name of the outgoing interface, the incoming interface is the entry of the network session The interface of the NAT device, the outgoing interface is the interface through which the network session exits from the NAT device; 根据所述结构化会话日志生成日志汇聚表,并依据所述NAT设备的出入路径表和所述日志汇聚表确定经过所述NAT设备的网络会话的访问方向;Generate a log aggregation table according to the structured session log, and determine the access direction of the network session passing through the NAT device according to the entry and exit path table of the NAT device and the log aggregation table; 根据所述访问方向提取所述网络会话在所述NAT设备处的局部网络访问关系。Extracting the local network access relationship of the network session at the NAT device according to the access direction. 3.根据权利要求1所述的方法,其特征在于,获取与多个NAT设备中每个NAT设备对应的结构化会话日志,包括:3. The method according to claim 1, wherein obtaining a structured session log corresponding to each NAT device in a plurality of NAT devices comprises: 获取多个NAT设备的多个日志,从所述多个日志中获取关键要素信息,其中,所述关键要素信息包括:时间戳、源网络地址、目的网络地址、目的端口、源映射网络地址、目的映射网络地址、目的映射端口、协议类型、源接口和目的接口;Obtain multiple logs of multiple NAT devices, and obtain key element information from the multiple logs, wherein the key element information includes: time stamp, source network address, destination network address, destination port, source mapping network address, Destination mapping network address, destination mapping port, protocol type, source interface and destination interface; 获取所述每个NAT设备的标识信息,其中,所述标识信息包括以下至少之一:Obtain the identification information of each NAT device, wherein the identification information includes at least one of the following: NAT设备的名称和所述NAT设备的网络地址;the name of the NAT device and the network address of the NAT device; 将所述每个NAT设备的关键要素信息和所述每个NAT设备的标识信息进行组合,得到所述每个NAT设备对应的结构化会话日志。Combining the key element information of each NAT device with the identification information of each NAT device to obtain a structured session log corresponding to each NAT device. 4.根据权利要求3所述的方法,其特征在于,根据所述结构化会话日志生成日志汇聚表,包括:4. The method according to claim 3, wherein generating a log aggregation table according to the structured session log includes: 确定预设周期,并采集在所述预设周期内的多个所述结构化会话日志;determining a preset period, and collecting multiple structured session logs within the preset period; 将多个所述结构化会话日志中除所述时间戳以外的其它关键要素信息完全相同的数据归类为一组数据,得到多组数据;Classify the data in the plurality of structured session logs that have the same key element information except for the time stamp into a group of data to obtain multiple groups of data; 根据所述多组数据生成日志汇聚表,其中,所述日志汇聚表包括:所述NAT设备的标识信息、所述关键要素信息和每组数据出现的次数。A log aggregation table is generated according to the multiple sets of data, wherein the log aggregation table includes: the identification information of the NAT device, the key element information, and the number of occurrences of each set of data. 5.根据权利要求2所述的方法,其特征在于,根据所述结构化会话日志生成日志汇聚表,并依据所述NAT设备的出入路径表和所述日志汇聚表确定经过所述NAT设备的网络会话的访问方向,包括:5. The method according to claim 2, characterized in that, generating a log aggregation table according to the structured session log, and determining the route through the NAT device according to the ingress and egress path table of the NAT device and the log aggregation table. The access direction of the network session, including: 获取所述日志汇聚表中的NAT设备的标识信息、与所述NAT设备的标识信息对应的源接口的名称以及与所述NAT设备的标识信息对应的目的接口的名称;Obtain the identification information of the NAT device in the log aggregation table, the name of the source interface corresponding to the identification information of the NAT device, and the name of the destination interface corresponding to the identification information of the NAT device; 利用所述NAT设备的标识信息、与所述NAT设备的标识信息对应的源接口的名称和与所述NAT设备的标识信息对应的目的接口的名称通过所述NAT设备的出入路径表确定经过所述NAT设备的标识信息指示的NAT设备的网络会话的访问方向。Use the identification information of the NAT device, the name of the source interface corresponding to the identification information of the NAT device, and the name of the destination interface corresponding to the identification information of the NAT device to determine through the ingress and egress path table of the NAT device. The access direction of the network session of the NAT device indicated by the identification information of the NAT device. 6.根据权利要求2所述的方法,其特征在于,根据所述访问方向提取所述网络会话在所述NAT设备处的局部网络访问关系,包括:6. The method according to claim 2, wherein extracting the local network access relationship of the network session at the NAT device according to the access direction comprises: 如果所述访问方向为入界,将与所述NAT设备的标识信息对应的源映射网络地址确定为内接口源网络地址,将与所述NAT设备的标识信息对应的目的网络地址确定为内接口目的网络地址,将与所述NAT设备的标识信息对应的目的端口确定为内接口目的端口,将与所述NAT设备的标识信息对应的源网络地址确定为外接口源网络地址,将与所述NAT设备的标识信息对应的目的映射网络地址确定为外接口目的网络地址,并将与所述NAT设备的标识信息对应的目的映射端口确定为外接口目的端口,其中,所述入界指示从所述网络边界外的设备访问所述网络边界内的设备;If the access direction is inbound, determine the source mapping network address corresponding to the identification information of the NAT device as the internal interface source network address, and determine the destination network address corresponding to the identification information of the NAT device as the internal interface Destination network address, determine the destination port corresponding to the identification information of the NAT device as the internal interface destination port, determine the source network address corresponding to the identification information of the NAT device as the external interface source network address, and use the The destination mapping network address corresponding to the identification information of the NAT device is determined as the destination network address of the external interface, and the destination mapping port corresponding to the identification information of the NAT device is determined as the destination port of the external interface, wherein the inbound indication is from the devices outside the network boundary to access devices within the network boundary; 根据所述内接口源网络地址、所述内接口目的网络地址、所述内接口目的端口、所述外接口源网络地址、所述外接口目的网络地址和所述外接口目的端口确定所述访问方向为入界时所述网络会话在所述NAT设备处的多个局部网络访问关系;Determine the access according to the source network address of the internal interface, the destination network address of the internal interface, the destination port of the internal interface, the source network address of the external interface, the destination network address of the external interface, and the destination port of the external interface Multiple local network access relationships of the network session at the NAT device when the direction is inbound; 如果所述访问方向为出界,将与所述NAT设备的标识信息对应的源网络地址确定为所述内接口源网络地址、将与所述NAT设备的标识信息对应的目的映射网络地址确定为所述内接口目的网络地址、将与所述NAT设备的标识信息对应的目的映射端口确定为所述内接口目的端口、将与所述NAT设备的标识信息对应的源映射网络地址确定为所述外接口源网络地址、将与所述NAT设备的标识信息对应的目的网络地址确定为所述外接口目的网络地址,并将与所述NAT设备的标识信息对应的目的端口确定为所述外接口目的端口,其中,所述出界指示从所述网络边界内的设备访问所述网络边界外的设备;If the access direction is out of bounds, determine the source network address corresponding to the identification information of the NAT device as the internal interface source network address, and determine the destination mapping network address corresponding to the identification information of the NAT device as the the destination network address of the internal interface, determine the destination mapping port corresponding to the identification information of the NAT device as the destination port of the internal interface, and determine the source mapping network address corresponding to the identification information of the NAT device as the external Interface source network address, determining the destination network address corresponding to the identification information of the NAT device as the destination network address of the external interface, and determining the destination port corresponding to the identification information of the NAT device as the destination of the external interface a port, wherein the out-of-bounds indicates access from a device within the network boundary to a device outside the network boundary; 根据所述内接口源网络地址、所述内接口目的网络地址、所述内接口目的端口、所述外接口源网络地址、所述外接口目的网络地址和所述外接口目的端口确定所述访问方向为出界时所述网络会话在所述NAT设备处的多个局部网络访问关系。Determine the access according to the source network address of the internal interface, the destination network address of the internal interface, the destination port of the internal interface, the source network address of the external interface, the destination network address of the external interface, and the destination port of the external interface The direction is multiple local network access relationships of the network session at the NAT device when the network session is out of bounds. 7.根据权利要求2所述的方法,其特征在于,将所述每个NAT设备的局部网络访问关系进行串联,得到所述每个NAT设备所属的网络边界的全路径网络访问关系,包括:7. The method according to claim 2, wherein the local network access relationship of each NAT device is connected in series to obtain the full-path network access relationship of the network boundary to which each NAT device belongs, including: 从所述NAT设备的出入路径表中确定所述NAT设备所属的网络边界中NAT设备的数量;determining the number of NAT devices in the network boundary to which the NAT device belongs from the ingress and egress path table of the NAT device; 如果所述数量大于一个,依据串联规则将同一个所述网络边界内的多个所述NAT设备的多个局部网络访问关系进行串联,得到所述全路径网络访问关系;If the number is greater than one, concatenating multiple local network access relationships of multiple NAT devices within the same network boundary according to a concatenation rule to obtain the full-path network access relationship; 如果所述数量等于一个,将所述NAT设备的局部网络访问关系确定为所述全路径网络访问关系。If the number is equal to one, determine the partial network access relationship of the NAT device as the full path network access relationship. 8.根据权利要求7所述的方法,其特征在于,依据串联规则将同一个所述网络边界内的多个所述NAT设备的多个局部网络访问关系进行串联,包括:8. The method according to claim 7, wherein, according to a concatenation rule, concatenating a plurality of local network access relationships of a plurality of said NAT devices in the same network boundary, comprising: 如果多个所述NAT设备中的第一NAT设备的内接口源网络地址等于多个所述NAT设备中的第二NAT设备的外接口源网络地址,所述第一NAT设备的内接口目的网络地址等于所述第二NAT设备的外接口目的网络地址,且所述第一NAT设备的内接口目的端口等于所述第二NAT设备的外接口目的端口,将所述第一NAT设备的局部网络访问关系和所述第二NAT设备的局部网络访问关系串联为网络边界的全路径访问关系,其中,所述第一NAT设备与所述第二NAT设备为属于同一个所述网络边界,所述第一NAT设备与所述第二NAT设备存在相邻的关系,且所述第一NAT设备的级联层级小于所述第二NAT设备的级联层级。If the source network address of the internal interface of the first NAT device in the multiple NAT devices is equal to the source network address of the external interface of the second NAT device in the multiple NAT devices, the destination network of the internal interface of the first NAT device The address is equal to the destination network address of the external interface of the second NAT device, and the destination port of the internal interface of the first NAT device is equal to the destination port of the external interface of the second NAT device, and the local network of the first NAT device The access relationship and the local network access relationship of the second NAT device are concatenated into a full-path access relationship of a network boundary, wherein the first NAT device and the second NAT device belong to the same network boundary, and the The first NAT device is adjacent to the second NAT device, and the cascading level of the first NAT device is smaller than the cascading level of the second NAT device. 9.根据权利要求1所述的方法,其特征在于,所述方法还包括:9. The method according to claim 1, further comprising: 将所述全路径网络访问关系中发起访问请求的设备对应的节点确定为开始节点,将所述全路径网络访问关系中接收所述访问请求的设备对应的节点确定为结束节点,并将所述全路径网络访问关系中的NAT设备确定为中间节点;Determining the node corresponding to the device initiating the access request in the full-path network access relationship as the start node, determining the node corresponding to the device receiving the access request in the full-path network access relationship as the end node, and setting the The NAT device in the full-path network access relationship is determined as an intermediate node; 将连接所述开始节点,所述中间节点和所述结束节点的线段确定为边,其中,所述边的方向根据所述网络会话穿过所述网络边界的访问方向确定,所述边的方向用箭头指示;Determining the line segment connecting the start node, the intermediate node and the end node as an edge, wherein the direction of the edge is determined according to the access direction of the network session passing through the network boundary, and the direction of the edge indicated by an arrow; 根据所述开始节点、所述中间节点、所述结束节点和所述边生成所述全路径网络访问关系的可视图;generating a visual view of the full-path network access relationship according to the start node, the intermediate node, the end node and the edge; 展示所述全路径网络访问关系的可视图。A visual view showing the full-path network access relationship. 10.一种全路径网络访问关系的展示系统,其特征在于,包括:终端设备、数据可视化服务器和数据处理服务器,其中,10. A display system for a full-path network access relationship, characterized in that it includes: a terminal device, a data visualization server and a data processing server, wherein, 所述终端设备,与所述数据可视化服务器连接,用于向所述数据可视化服务器发送用于请求访问网络边界的全路径网络访问关系的查询请求,并展示所述全路径网络访问关系;The terminal device is connected to the data visualization server, and is used to send a query request to the data visualization server for requesting access to the full-path network access relationship of the network boundary, and display the full-path network access relationship; 所述数据可视化服务器,与所述数据处理服务器连接,用于响应所述查询请求并获取与所述全路径网络访问关系对应的数据;The data visualization server is connected to the data processing server, and is used to respond to the query request and obtain data corresponding to the full-path network access relationship; 所述数据处理服务器,用于获取多个NAT设备的多个日志,将所述多个日志转换为与所述多个NAT设备中每个NAT设备对应的结构化会话日志,根据所述每个NAT设备对应的结构化会话日志,提取网络会话在每个NAT设备处的局部网络访问关系,将在所述每个NAT设备处的局部网络访问关系进行串联,得到所述每个NAT设备所属的网络边界的全路径网络访问关系,存储与所述全路径网络访问关系对应的数据,并向所述数据可视化服务器下发与所述全路径网络访问关系对应的数据,其中,所述网络会话为在所述网络边界内的设备和在所述网络边界外的设备之间进行的会话。The data processing server is configured to obtain multiple logs of multiple NAT devices, convert the multiple logs into structured session logs corresponding to each NAT device in the multiple NAT devices, and according to each The structured session log corresponding to the NAT device extracts the local network access relationship of the network session at each NAT device, connects the local network access relationships at each NAT device in series, and obtains the local network access relationship to which each NAT device belongs The full-path network access relationship at the network boundary stores the data corresponding to the full-path network access relationship, and sends the data corresponding to the full-path network access relationship to the data visualization server, wherein the network session is A session between a device within the network boundary and a device outside the network boundary. 11.一种获取全路径网络访问关系的装置,其特征在于,包括:11. A device for obtaining a full-path network access relationship, characterized in that it comprises: 获取模块,用于获取与多个NAT设备中每个NAT设备对应的结构化会话日志;An acquisition module, configured to acquire a structured session log corresponding to each NAT device in a plurality of NAT devices; 提取模块,用于根据所述每个NAT设备对应的结构化会话日志,提取网络会话在所述每个NAT设备处的局部网络访问关系,其中,所述网络会话为在每个NAT设备所属的网络边界内的设备和在所述每个NAT设备所属的网络边界外的设备之间进行的会话;An extracting module, configured to extract the local network access relationship of the network session at each NAT device according to the structured session log corresponding to each NAT device, wherein the network session is the network session to which each NAT device belongs a session between a device within the network boundary and a device outside the network boundary to which each of said NAT devices belongs; 处理模块,用于将所述网络会话在所述每个NAT设备处的局部网络访问关系进行串联,得到所述每个NAT设备所属的网络边界的全路径网络访问关系。A processing module, configured to concatenate the partial network access relationship of the network session at each NAT device to obtain the full-path network access relationship of the network boundary to which each NAT device belongs. 12.一种非易失性存储介质,其特征在于,所述非易失性存储介质中存储有计算机程序,其中,所述非易失性存储介质所在设备通过运行所述计算机程序执行权利要求1至9中任意一项所述的全路径网络访问关系的方法。12. A non-volatile storage medium, wherein a computer program is stored in the non-volatile storage medium, wherein the device where the non-volatile storage medium is located executes the claim by running the computer program The method for the full-path network access relationship described in any one of 1 to 9. 13.一种电子装置,包括存储器和处理器,其特征在于,所述存储器中存储有计算机程序,所述处理器被设置为通过所述计算机程序执行权利要求1至9中任意一项所述的全路径网络访问关系的方法。13. An electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the computer program described in any one of claims 1 to 9 through the computer program. The full-path network access method for relationships.
CN202310454802.9A 2023-04-24 2023-04-24 Method and device for obtaining full-path network access relationship Active CN116455801B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310454802.9A CN116455801B (en) 2023-04-24 2023-04-24 Method and device for obtaining full-path network access relationship

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310454802.9A CN116455801B (en) 2023-04-24 2023-04-24 Method and device for obtaining full-path network access relationship

Publications (2)

Publication Number Publication Date
CN116455801A true CN116455801A (en) 2023-07-18
CN116455801B CN116455801B (en) 2025-09-05

Family

ID=87120125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310454802.9A Active CN116455801B (en) 2023-04-24 2023-04-24 Method and device for obtaining full-path network access relationship

Country Status (1)

Country Link
CN (1) CN116455801B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117112689A (en) * 2023-09-20 2023-11-24 建信金融科技有限责任公司 Application association relation discovery method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227408A (en) * 2008-02-02 2008-07-23 中兴通讯股份有限公司 Method and Router for IPv4 Internal Private Network to Access IPv6 Network
US20120214445A1 (en) * 2009-11-02 2012-08-23 Lg Electronics Inc Nat traversal for local ip access
CN110062046A (en) * 2019-04-24 2019-07-26 全知科技(杭州)有限责任公司 A kind of data access complete trails related auditing method
CN110120947A (en) * 2019-04-30 2019-08-13 日海通信服务有限公司 A kind of digital network access method based on security boundary
US20210344725A1 (en) * 2020-04-30 2021-11-04 Rockwell Automation Technologies, Inc. Securely deploying security policy and configuration through network address translation systems

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227408A (en) * 2008-02-02 2008-07-23 中兴通讯股份有限公司 Method and Router for IPv4 Internal Private Network to Access IPv6 Network
US20120214445A1 (en) * 2009-11-02 2012-08-23 Lg Electronics Inc Nat traversal for local ip access
CN110062046A (en) * 2019-04-24 2019-07-26 全知科技(杭州)有限责任公司 A kind of data access complete trails related auditing method
CN110120947A (en) * 2019-04-30 2019-08-13 日海通信服务有限公司 A kind of digital network access method based on security boundary
US20210344725A1 (en) * 2020-04-30 2021-11-04 Rockwell Automation Technologies, Inc. Securely deploying security policy and configuration through network address translation systems

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GAO FUXIANG 等: "《A Security Architecture for Intranet Based on Security Area Divison》", 《IEEE》, 30 April 2010 (2010-04-30) *
刘武军: "《IPv4-IPv6基于NAT-PT的过渡技术的研究》", 《中国优秀硕士论文全文数据库》, 15 July 2012 (2012-07-15) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117112689A (en) * 2023-09-20 2023-11-24 建信金融科技有限责任公司 Application association relation discovery method and device and electronic equipment

Also Published As

Publication number Publication date
CN116455801B (en) 2025-09-05

Similar Documents

Publication Publication Date Title
KR102183897B1 (en) An apparatus for anomaly detecting of network based on artificial intelligent and method thereof, and system
TW476204B (en) Information security analysis system
TW470879B (en) Information security analysis system
Glatz et al. Visualizing big network traffic data using frequent pattern mining and hypergraphs
Chi et al. Cyclops: the AS-level connectivity observatory
CN108833437A (en) An APT detection method based on traffic fingerprint and communication feature matching
Dusi et al. Quantifying the accuracy of the ground truth associated with Internet traffic traces
US20190007292A1 (en) Apparatus and method for monitoring network performance of virtualized resources
CN109379390B (en) Network security baseline generation method based on full flow
AU757353B2 (en) Information security analysis system
CN115883223A (en) Method and device for generating user risk profile, electronic device, storage medium
CN111953552B (en) Data flow classification method and message forwarding equipment
CN114338600A (en) Equipment fingerprint selection method and device, electronic equipment and medium
Layeghy et al. Benchmarking the Benchmark--Analysis of Synthetic NIDS Datasets
CN111200543A (en) Encryption protocol identification method based on active service detection engine technology
CN116455801A (en) Method and device for acquiring full path network access relation
CN114553546B (en) Message grabbing method and device based on network application
CN115437874A (en) Information security risk analysis and monitoring system based on network assets
CN112187720B (en) Method, device, electronic device and storage medium for generating a secondary attack chain
CN117041070B (en) A method and device for discovering and identifying nodes in network space surveying and mapping
Zhou et al. Classification of botnet families based on features self-learning under network traffic censorship
Ten et al. Study on advanced visualization tools in network monitoring platform
CN111343008B (en) Comprehensive measurement method and system for discovering IPv6 accelerated deployment state
CN114244727A (en) Instant generation method and system for power Internet of things communication panorama
CN115866101A (en) Method, device, and medium for asset attribution identification with multi-protocol linkage between internal and external networks

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
GR01 Patent grant
GR01 Patent grant