CN114844707A - 一种基于图数据库的电网网络安全分析方法及系统 - Google Patents

一种基于图数据库的电网网络安全分析方法及系统 Download PDF

Info

Publication number
CN114844707A
CN114844707A CN202210492336.9A CN202210492336A CN114844707A CN 114844707 A CN114844707 A CN 114844707A CN 202210492336 A CN202210492336 A CN 202210492336A CN 114844707 A CN114844707 A CN 114844707A
Authority
CN
China
Prior art keywords
data
graph
database
grid network
power grid
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
CN202210492336.9A
Other languages
English (en)
Other versions
CN114844707B (zh
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.)
Nari Information and Communication Technology Co
Original Assignee
Nari Information and Communication Technology Co
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 Nari Information and Communication Technology Co filed Critical Nari Information and Communication Technology Co
Priority to CN202210492336.9A priority Critical patent/CN114844707B/zh
Publication of CN114844707A publication Critical patent/CN114844707A/zh
Application granted granted Critical
Publication of CN114844707B publication Critical patent/CN114844707B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • H04L63/1416Event detection, e.g. attack signature detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • H04L63/1425Traffic logging, e.g. anomaly detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances
    • 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
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S40/00Systems for electrical power generation, transmission, distribution or end-user application management characterised by the use of communication or information technologies, or communication or information technology specific aspects supporting them
    • Y04S40/20Information technology specific aspects, e.g. CAD, simulation, modelling, system security

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Animal Behavior & Ethology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Power Engineering (AREA)
  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种基于图数据库的电网网络安全分析方法及系统,其方法包括:采集各种电网网络安全数据,对所述安全数据进行去噪去重处理后存储到数据库mysql中;采用多线程并行的方式,将数据库mysql中每个数据表通过单独线程加载到内存集合;在内存合集中构建各类节点和关系形成Neo4jCypher语句;基于Neo4jCypher语句通过图数据库Neo4j全量和增量构建知识图谱;编写DockerFile文件将上述步骤打包成镜像,运行到docker容器中实现快速部署;本发明能够提高攻击链路溯源能力以及部署灵活性和拓展性。

Description

一种基于图数据库的电网网络安全分析方法及系统
技术领域
本发明涉及一种基于图数据库的电网网络安全分析方法及系统,属于计算机信息处理技术领域。
背景技术
互联网基础设施的不断发展和新应用的不断涌现使得网络规模逐渐扩大,拓扑结构日益复杂,网络安全管理的难度不断增加。为了应对日益复杂、隐蔽的网络威胁,各种检测技术相继出现,如脆弱性检测技术、恶意代码检测技术、入侵检测技术等。这些技术试图从不同的角度发现网络中可能存在的安全问题,但在是否主动、有效地应对各种安全事件方面不够理想,限制了网络安全管理员做出最佳响应决策的能力。
发明内容
本发明的目的在于克服现有技术中的不足,提供一种基于图数据库的电网网络安全分析方法及系统,能够提高攻击链路溯源能力以及部署灵活性和拓展性。
为达到上述目的,本发明是采用下述技术方案实现的:
第一方面,本发明提供了一种基于图数据库的电网网络安全分析方法,包括:
采集各种电网网络安全数据,对所述安全数据进行去噪去重处理后存储到数据库mysql中;
采用多线程并行的方式,将数据库mysql中每个数据表通过单独线程加载到内存集合;
在内存合集中构建各类节点和关系形成Neo4jCypher语句;
基于Neo4jCypher语句通过图数据库Neo4j全量和增量构建知识图谱;
编写DockerFile文件将上述步骤打包成镜像,运行到docker容器中实现快速部署。
可选的,所述采集各种电网网络安全数据包括通过webservice和UDP的方式获取告警日志、主机登录日志、主机信息日志以及威胁情报日志;所述告警日志包括攻击源、被攻击目标、所属系统、运维单位以及地理信息;所述威胁情报日志包括威胁情报数据;所述主机信息日志包括操作系统和mac地址;所述主机登录日志包括主机登录数据。
可选的,所述对所述安全数据进行去重去噪处理包括:
去噪:将安全数据与预设格式进行匹配,将与预设格式对应的属性个数和要求不一致的记录删除;
去重:在预设时间间隔内,若安全数据中多次出现仅时间属性不同的记录,则只保留时间最后的记录。
可选的,所述存储到数据库mysql中包括将不同类型的安全数据转换成数据对象并存储到数据库mysql中不同的数据表中。
可选的,所述构建各类节点和关系形成Neo4jCypher语句包括构建被攻击目标和操作系统关系图、被攻击目标和mac地址关系图、攻击源和威胁情报数据关系图、攻击源和被攻击目标关系图。
可选的,所述构建知识图谱包括:
将Neo4jCypher语句发送至图数据库Neo4j,进行端和边的构建;
全量:每隔1天删除图数据库Neo4j中所有Neo4jCypher语句,然后加载过去三个月的Neo4jCypher语句;
增量:每隔5分钟加载过去5分钟新增的Neo4jCypher语句。
第二方面,本发明提供了一种基于图数据库的电网网络安全分析系统,所述系统包括:
数据准备模块,用于采集各种电网网络安全数据,对所述安全数据进行去噪去重处理后存储到数据库mysql中;
数据加载模块,用于采用多线程并行的方式,将数据库mysql中每个数据表通过单独线程加载到内存集合;
关系图模块,用于在内存合集中构建各类节点和关系形成Neo4jCypher语句;
知识图谱模块,用于基于Neo4jCypher语句通过图数据库全量和增量构建知识图谱;
方法部署模块,用于编写DockerFile文件将上述步骤打包成镜像,运行到docker容器中实现快速部署。
与现有技术相比,本发明所达到的有益效果:
本发明提供的一种基于图数据库的电网网络安全分析方法及系统,通过使用图数据库Neo4j对电网网络安全领域的数据进行知识图谱构建,通过对安全数据的查询和展现,提供一种更加丰富的展示攻击路径信息及技防设备检测信息的方法,提高攻击链路溯源能力;同时通过docker容器化部署技术,提供较高的部署灵活性,支持对不断演变的安全威胁进行持续分析,可随新业务需求的增长而不断扩展。
附图说明
图1是本发明实施例提供的一种基于图数据库的电网网络安全分析方法的流程图;
图2是本发明实施例提供的基于图数据库的电网网络安全分析的数据流转图;
图3是本发明实施例提供的被攻击目标和操作系统关系图;
图4是本发明实施例提供的攻击源和被攻击目标关系图;
图5是本发明实施例提供的知识图谱展示示意图。
具体实施方式
下面结合附图对本发明作进一步描述。以下实施例仅用于更加清楚地说明本发明的技术方案,而不能以此来限制本发明的保护范围。
实施例一:
如图1-2所示,本发明提供了一种基于图数据库的电网网络安全分析方法,包括以下步骤:
S1、采集各种电网网络安全数据,对安全数据进行去噪去重处理后存储到数据库mysql中;
S101、采集各种电网网络安全数据包括通过webservice和UDP的方式获取告警日志、主机登录日志、主机信息日志以及威胁情报日志。
告警日志包括攻击源、被攻击目标、所属系统、运维单位以及地理信息;威胁情报日志包括威胁情报数据;主机信息日志包括操作系统和mac地址;主机登录日志包括主机登录数据。
S102、对安全数据进行去重去噪处理包括:
去噪:将安全数据与预设格式进行匹配,将与预设格式对应的属性个数和要求不一致的记录删除;
去重:在预设时间间隔内,若安全数据中多次出现仅时间属性不同的记录,则只保留时间最后的记录。
S103、存储到数据库mysql中包括将不同类型的安全数据转换成数据对象并存储到数据库mysql中不同的数据表中。数据表包括与告警表、主机信息表、主机登录表以及威胁情报表。
S2、采用多线程并行的方式,将数据库mysql中每个数据表通过单独线程加载到内存集合;根据数据的类型,分别反序列化成对应的对象。
S3、在内存合集中构建各类节点和关系形成Neo4jCypher语句;
构建各类节点和关系形成Neo4jCypher语句包括构建被攻击目标和操作系统关系图、被攻击目标和mac地址关系图、攻击源和威胁情报数据关系图、攻击源和被攻击目标关系图。
S301、构建被攻击目标和操作系统关系图、被攻击目标和mac地址关系图:
获取主机信息数据集合host_infos,它是一个哈希表,key是对应的被攻击目标Ip,value是一个二元组,分别存放被攻击目标Ip对应的操作系统和mac地址。
a.根据图数据库{节点,关系,节点}三元组原则,左节点设置被攻击目标Ip,右节点设置操作系统或者mac地址,关系设置为{"type":"OperatSystem"}或者{"type":"MacAddress"};
b.根据预先定义好的创建知识图谱节点的CQL语句,动态替换其中的节点类型,形成操作系统和mac地址节点Neo4j Cypher语句;
c.根据预先定义好的创建主机和操作系统关系以及主机和mac地址关系的CQL语句,动态替换其中的关系类型,形成主机和操作系统、mac地址关系Neo4j Cypher语句。
Python核心代码如下:
OperatSystem_Cql="UNWIND$rels_list AS n match(a:IpAddress{name:n.left.name}),(b:OperatSystem{name:n.right.name})"\"create(a)-[r:操作系统{type:n.rel.type}]->(b)"
MacAddress_Cql="UNWIND$rels_list AS n match(a:IpAddress{name:n.left.name}),(b:MacAddress{name:n.right.name})"\"create(a)-[r:MAC地址{type:n.rel.type}]->(b)"
host_infos=get_host_info(msql_pool)
log.info(f"获得主机信息数据:{len(host_infos)}")
ip_lists=[]
os_lists=[]
mac_lists=[]
rel_nodes={}
rel_nodes["操作系统"]=[]
rel_nodes["MAC地址"]=[]
for ip,(operat_system,mac)in host_infos.items():
ifip==None or ip=="":
continue
ip_lists.append(ip)
if operat_system!=None and operat_system!="":
os_lists.append(operat_system)
os_rel={}
os_rel["left"]={"name":ip}
os_rel["right"]={"name":operat_system}
os_rel["rel"]={"type":"OperatSystem"}
rel_nodes["操作系统"].append(os_rel)
if mac!=None and mac!="":
mac=mac.upper()
mac_lists.append(mac)
mac_rel={}
mac_rel["left"]={"name":ip}
mac_rel["right"]={"name":mac}
mac_rel["rel"]={"type":"MacAddress"}
rel_nodes["MAC地址"].append(mac_rel)
#创建ip节点
create_name_nodes(neo4j_driver,redis_cli,ip_lists,"IpAddress")
#创建操作系统节点
create_name_nodes(neo4j_driver,redis_cli,os_lists,"OperatSystem")
#创建mac地址节点
create_name_nodes(neo4j_driver,redis_cli,mac_lists,"MacAddress")
#创建主机和操作系统关系
create_relations(neo4j_driver,redis_cli,rel_nodes["操作系统"],OperatSystem_Cql,"OperatSystem",os_nodekey)
#创建主机和mac地址关系
create_relations(neo4j_driver,redis_cli,rel_nodes["MAC地址"],MacAddress_Cql,"MacAddress",mac_nodekey)
被攻击目标和操作系统关系图的示例如图3所示。
S302、构建攻击源和威胁情报数据关系图:
获取威胁情报数据集合ip_reputations,它是一个二元组,key是对应的被攻击目标Ip,value是该IP对应的情报标签。
a.根据图数据库{节点,关系,节点}三元组原则,左节点设置被攻击目标Ip,右节点设置威胁情报标签,关系设置为{"type":"IpThreat"};
b.根据预先定义好的创建知识图谱节点的CQL语句,动态替换其中的节点类型,形成Ip节点和威胁情报标签节点Neo4j Cypher语句;
c.根据预先定义好的创建IP和情报关系的CQL语句,动态替换其中的关系类型,形成Ip和威胁情报标签关系Neo4j Cypher语句。
Python核心代码如下:
IpThreat_Cql="UNWIND$rels_list AS n match(a:IpAddress{name:n.left.name}),(b:ThreatLabel{name:n.right.name})create(a)-[r:威胁情报{type:n.rel.type}]->(b)"
ip_reputations=get_ip_reputation_label(msql_pool)
log.info(f"获得威胁情报数据:{len(ip_reputations)}")
#从reputation_label表中创建威胁情报关联图
ip_lists=[]
label_lists=[]
rel_nodes=[]
for datas in ip_reputations:
ip=datas[0]
threat_label=datas[1]
if ip==None or ip==""or threat_label==None or threat_label=="":continue
ip_lists.append(ip)
label_lists.append(threat_label)
rel={}
rel["left"]={"name":ip}
rel["right"]={"name":threat_label}
rel["rel"]={"type":"IpThreat"}
rel_nodes.append(rel)
#创建ip节点
create_name_nodes(neo4j_driver,redis_cli,ip_lists,"IpAddress")
#创建威胁标签节点
create_name_nodes(neo4j_driver,redis_cli,label_lists,"ThreatLabel")
#创建ip威胁标签关系
create_relations(neo4j_driver,redis_cli,rel_nodes,IpThreat_Cql,"IpThreat",ipthreat_nodekey)
S303、构建攻击源和被攻击目标关系图:
获取告警数据集合event_warnings,它是一个多元组,包含告警名称、告警次数、攻击源IP、被攻击目标IP等数据。
a.根据图数据库{节点,关系,节点}三元组原则,左节点设置攻击源Ip,右节点设置被攻击目标Ip,关系设置为{"type":"AttackName","ID":ID,"Create_Time":Create_Time,"warning_count":warning_count,"WarningTime":WarningTime,"warning_src":warning_src,"WarningName":WarningName,"WarningLevel":WarningLevel,"src_in_res":src_in_res,"target_in_res":target_in_res,"Log_StartTime":Log_StartTime,"Log_EndTime":Log_EndTime,"WarningStatus_code":WarningStatus_code,"src_ip":src_ip,"target_ip":target_ip,"WarningSubType":WarningSubType,"warningsrc_code":warningsrc_code,"warningsrc_subcode":warningsrc_subcode},相同告警名称的三元组放到一个列表中;
b.根据预先定义好的创建知识图谱节点的CQL语句,动态替换其中的节点类型,形成攻击源IP和被攻击目标IP节点Neo4jCypher语句;c.根据预先定义好的攻击源IP和被攻击目标IP关系的CQL语句,动态添加其中的关系类型,形成攻击源IP和被攻击目标IP关系Neo4j Cypher语句。
Python核心代码如下
AttackName_Create_Cql="UNWIND$rels_list AS n match(a:IpAddress{name:n.left.name}),(b:IpAddress{name:n.right.name})"\"create(a)-[r:被攻击目标{type:n.rel.type,ID:n.rel.ID,Create_Time:n.rel.Create_Time,warning_count:n.rel.warning_count,"\"WarningTime:n.rel.WarningTime,warning_src:n.rel.warning_src,WarningName:n.rel.WarningName,WarningLevel:n.rel.WarningLevel,"\"src_in_res:n.rel.src_in_res,target_in_res:n.rel.target_in_res,Log_StartTime:n.rel.Log_StartTime,Log_EndTime:n.rel.Log_EndTime,"\"WarningStatus_code:n.rel.WarningStatus_code,src_ip:n.rel.src_ip,target_ip:n.rel.target_ip,WarningSubType:n.rel.WarningSubType,"\"warningsrc_code:n.rel.warningsrc_code,warningsrc_subcode:n.rel.warningsrc_subcode}]->(b)"AttackName_Set_Cql="UNWIND$rels_list AS n match(a:IpAddress{name:n.left.name})-[r:被攻击目标{type:n.rel.type,ID:n.rel.ID}]->(b:IpAddress{name:n.right.name})"\"setr.Create_Time=n.rel.Create_Time,r.warning_count=n.rel.warning_count,r.WarningTime=n.rel.WarningTime,r.warning_src=n.rel.warning_src,"\"r.WarningName=n.rel.WarningName,r.WarningLevel=n.rel.WarningLevel,r.src_in_res=n.rel.src_in_res,r.target_in_res=n.rel.target_in_res,"\"r.Log_StartTime=n.rel.Log_StartTime,r.Log_EndTime=n.rel.Log_EndTime,r.WarningStatus_code=n.rel.WarningStatus_code,r.src_ip=n.rel.src_ip,"\"r.target_ip=n.rel.target_ip,r.WarningSubType=n.rel.WarningSubType,r.warningsrc_code=n.rel.warningsrc_code,r.warningsrc_subcode=n.rel.warningsrc_subcode"event_warnings=get_event_warning(msql_pool,start_tm)attack_nodes={}forwarning in event_warnings:
#创建攻击关系
if WarningName not in attack_nodes:
attack_nodes[WarningName]=[]
attack_rel={}
attack_rel["left"]={"name":AttackSrc}
attack_rel["right"]={"name":AttackTarget}
attack_rel["rel"]={"type":"AttackName","ID":ID,"Create_Time":Create_Time,"warning_count":warning_count,"WarningTime":WarningTime,"warning_src":warning_src,"WarningName":WarningName,"WarningLevel":WarningLevel,"src_in_res":src_in_res,"target_in_res":target_in_res,"Log_StartTime":Log_StartTime,"Log_EndTime":Log_EndTime,"WarningStatus_code":WarningStatus_code,"src_ip":src_ip,"target_ip":target_ip,"WarningSubType":WarningSubType,"warningsrc_code":warningsrc_code,"warningsrc_subcode":warningsrc_subcode}attack_nodes[WarningName].append(attack_rel)
#创建ip节点
create_name_nodes(neo4j_driver,redis_cli,ip_lists,"IpAddress")
#创建攻击关系
for k,v in attack_nodes.items():
create_cql=AttackName_Create_Cql.replace("被攻击目标",k)
set_cql=AttackName_Set_Cql.replace("被攻击目标",k)
create_set_relations(neo4j_driver,redis_cli,v,create_cql,set_cql,"AttackName",event_nodekey)
攻击源和被攻击目标关系图的示例如图4所示。
S4、基于Neo4jCypher语句通过图数据库Neo4j全量和增量构建知识图谱;
构建知识图谱包括:
将Neo4jCypher语句发送至图数据库Neo4j,进行端和边的构建;
全量:每隔1天删除图数据库Neo4j中所有Neo4jCypher语句,然后加载过去三个月的Neo4jCypher语句;
增量:每隔5分钟加载过去5分钟新增的Neo4jCypher语句。
知识图谱的示例如图5所示。
S5、编写DockerFile文件将上述步骤打包成镜像,运行到docker容器中实现快速部署;具体包括:
步骤1)安装docker运行环境。
步骤2)编写DockerFile文件,将上述方法程序打包成镜像。
步骤3)启动服务,docker基于容器化,沙箱机制,可使你用较少的命令和脚本快速部署应用。一次构建,多处移植使用。再配合shell等脚本语言,可实现脚本化一键部署。
实施例二:
本发明实施例提供了一种基于图数据库的电网网络安全分析系统,系统包括:
数据准备模块,用于采集各种电网网络安全数据,对安全数据进行去噪去重处理后存储到数据库mysql中;
数据加载模块,用于采用多线程并行的方式,将数据库mysql中每个数据表通过单独线程加载到内存集合;
关系图模块,用于在内存合集中构建各类节点和关系形成Neo4jCypher语句;
知识图谱模块,用于基于Neo4jCypher语句通过图数据库全量和增量构建知识图谱;
方法部署模块,用于编写DockerFile文件将上述步骤打包成镜像,运行到docker容器中实现快速部署。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明技术原理的前提下,还可以做出若干改进和变形,这些改进和变形也应视为本发明的保护范围。

Claims (7)

1.一种基于图数据库的电网网络安全分析方法,其特征在于,包括:
采集各种电网网络安全数据,对所述安全数据进行去噪去重处理后存储到数据库mysql中;
采用多线程并行的方式,将数据库mysql中每个数据表通过单独线程加载到内存集合;
在内存合集中构建各类节点和关系形成Neo4jCypher语句;
基于Neo4jCypher语句通过图数据库Neo4j全量和增量构建知识图谱;
编写DockerFile文件将上述步骤打包成镜像,运行到docker容器中实现快速部署。
2.根据权利要求1所述的一种基于图数据库的电网网络安全分析方法,其特征在于,所述采集各种电网网络安全数据包括通过webservice和UDP的方式获取告警日志、主机登录日志、主机信息日志以及威胁情报日志;所述告警日志包括攻击源、被攻击目标、所属系统、运维单位以及地理信息;所述威胁情报日志包括威胁情报数据;所述主机信息日志包括操作系统和mac地址;所述主机登录日志包括主机登录数据。
3.根据权利要求1所述的一种基于图数据库的电网网络安全分析方法,其特征在于,所述对所述安全数据进行去重去噪处理包括:
去噪:将安全数据与预设格式进行匹配,将与预设格式对应的属性个数和要求不一致的记录删除;
去重:在预设时间间隔内,若安全数据中多次出现仅时间属性不同的记录,则只保留时间最后的记录。
4.根据权利要求1所述的一种基于图数据库的电网网络安全分析方法,其特征在于,所述存储到数据库mysql中包括将不同类型的安全数据转换成数据对象并存储到数据库mysql中不同的数据表中。
5.根据权利要求2所述的一种基于图数据库的电网网络安全分析方法,其特征在于,所述构建各类节点和关系形成Neo4jCypher语句包括构建被攻击目标和操作系统关系图、被攻击目标和mac地址关系图、攻击源和威胁情报数据关系图、攻击源和被攻击目标关系图。
6.根据权利要求1所述的一种基于图数据库的电网网络安全分析方法,其特征在于,所述构建知识图谱包括:
将Neo4jCypher语句发送至图数据库Neo4j,进行端和边的构建;
全量:每隔1天删除图数据库Neo4j中所有Neo4jCypher语句,然后加载过去三个月的Neo4jCypher语句;
增量:每隔5分钟加载过去5分钟新增的Neo4jCypher语句。
7.一种基于图数据库的电网网络安全分析系统,其特征在于,所述系统包括:
数据准备模块,用于采集各种电网网络安全数据,对所述安全数据进行去噪去重处理后存储到数据库mysql中;
数据加载模块,用于采用多线程并行的方式,将数据库mysql中每个数据表通过单独线程加载到内存集合;
关系图模块,用于在内存合集中构建各类节点和关系形成Neo4jCypher语句;
知识图谱模块,用于基于Neo4jCypher语句通过图数据库全量和增量构建知识图谱;
方法部署模块,用于编写DockerFile文件将上述步骤打包成镜像,运行到docker容器中实现快速部署。
CN202210492336.9A 2022-05-07 2022-05-07 一种基于图数据库的电网网络安全分析方法及系统 Active CN114844707B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210492336.9A CN114844707B (zh) 2022-05-07 2022-05-07 一种基于图数据库的电网网络安全分析方法及系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210492336.9A CN114844707B (zh) 2022-05-07 2022-05-07 一种基于图数据库的电网网络安全分析方法及系统

Publications (2)

Publication Number Publication Date
CN114844707A true CN114844707A (zh) 2022-08-02
CN114844707B CN114844707B (zh) 2024-04-02

Family

ID=82566869

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210492336.9A Active CN114844707B (zh) 2022-05-07 2022-05-07 一种基于图数据库的电网网络安全分析方法及系统

Country Status (1)

Country Link
CN (1) CN114844707B (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116319077A (zh) * 2023-05-15 2023-06-23 鹏城实验室 网络攻击检测方法和装置、设备、存储介质和产品
CN116827900A (zh) * 2023-08-31 2023-09-29 青岛民航凯亚系统集成有限公司 一种基于Python实现内网终端溯源的方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108270785A (zh) * 2018-01-15 2018-07-10 中国人民解放军国防科技大学 一种基于知识图谱的分布式安全事件关联分析方法
CN111198852A (zh) * 2019-12-30 2020-05-26 浪潮通用软件有限公司 微服务架构下知识图谱驱动的元数据关系推理方法
US11216265B1 (en) * 2020-07-02 2022-01-04 Ryan L. Hornbeck Repeatable security hardening for virtualized hardware and infrastructure
CN114070629A (zh) * 2021-11-16 2022-02-18 南京南瑞信息通信科技有限公司 针对apt攻击的安全编排与自动化响应方法、装置及系统
CN114116872A (zh) * 2021-11-29 2022-03-01 国网北京市电力公司 数据处理方法、装置、电子设备及计算机可读存储介质
CN114297173A (zh) * 2021-06-18 2022-04-08 北京大学 一种面向大规模海量数据的知识图谱构建方法和系统

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108270785A (zh) * 2018-01-15 2018-07-10 中国人民解放军国防科技大学 一种基于知识图谱的分布式安全事件关联分析方法
CN111198852A (zh) * 2019-12-30 2020-05-26 浪潮通用软件有限公司 微服务架构下知识图谱驱动的元数据关系推理方法
US11216265B1 (en) * 2020-07-02 2022-01-04 Ryan L. Hornbeck Repeatable security hardening for virtualized hardware and infrastructure
CN114297173A (zh) * 2021-06-18 2022-04-08 北京大学 一种面向大规模海量数据的知识图谱构建方法和系统
CN114070629A (zh) * 2021-11-16 2022-02-18 南京南瑞信息通信科技有限公司 针对apt攻击的安全编排与自动化响应方法、装置及系统
CN114116872A (zh) * 2021-11-29 2022-03-01 国网北京市电力公司 数据处理方法、装置、电子设备及计算机可读存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陶源;黄涛;李末岩;胡巍;: "基于知识图谱驱动的网络安全等级保护日志审计分析模型研究", 信息网络安全, no. 01, 10 January 2020 (2020-01-10) *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116319077A (zh) * 2023-05-15 2023-06-23 鹏城实验室 网络攻击检测方法和装置、设备、存储介质和产品
CN116319077B (zh) * 2023-05-15 2023-08-22 鹏城实验室 网络攻击检测方法和装置、设备、存储介质和产品
CN116827900A (zh) * 2023-08-31 2023-09-29 青岛民航凯亚系统集成有限公司 一种基于Python实现内网终端溯源的方法及系统
CN116827900B (zh) * 2023-08-31 2023-12-05 青岛民航凯亚系统集成有限公司 一种基于Python实现内网终端溯源的方法及系统

Also Published As

Publication number Publication date
CN114844707B (zh) 2024-04-02

Similar Documents

Publication Publication Date Title
US11277446B2 (en) Event integration frameworks
US10649838B2 (en) Automatic correlation of dynamic system events within computing devices
CN114844707A (zh) 一种基于图数据库的电网网络安全分析方法及系统
US10885393B1 (en) Scalable incident-response and forensics toolkit
US9588821B2 (en) Automatic determination of required resource allocation of virtual machines
US20160085792A1 (en) Systems and methods for large-scale system log analysis, deduplication and management
US10133622B2 (en) Enhanced error detection in data synchronization operations
US20080148398A1 (en) System and Method for Definition and Automated Analysis of Computer Security Threat Models
US9584533B2 (en) Performance enhancements for finding top traffic patterns
US20120096065A1 (en) System and method for monitoring system performance changes based on configuration modification
CN110168523A (zh) 改变监测跨图查询
CN111090440B (zh) 信息处理方法、系统、设备及存储介质
US20240031425A1 (en) System and method for analyzing network objects in a cloud environment
WO2019084072A1 (en) GRAPHIC MODEL FOR ALERT INTERPRETATION IN AN ENTERPRISE SECURITY SYSTEM
CN113505048A (zh) 基于应用系统画像的统一监控平台及实现方法
US20130018910A1 (en) Enterprise Intelligence ('EI') Reporting In An EI Framework
CN114944956A (zh) 一种攻击链路检测方法、装置、电子设备及存储介质
US11962623B2 (en) Static analysis techniques for determining reachability properties of network and computing objects
CN115712646A (zh) 一种告警策略生成方法、装置和存储介质
US20230344839A1 (en) Systems and methods for event detection
US20130018695A1 (en) Enterprise Intelligence ('EI') Assembly Analysis In An EI Framework
CN108959659B (zh) 一种大数据平台的日志接入解析方法和系统
CN114531306B (zh) 一种基于威胁行为的实时检测方法与系统
US8677184B2 (en) System, method, and computer program product for gathering device information to enable identification of potential risks in a network environment
Collier et al. Machine Learning with the Elastic Stack: Expert techniques to integrate machine learning with distributed search and analytics

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