Temporal Multi-Query Subgraph Matching in Cybersecurity
Abstract
1. Introduction
2. Preliminaries
2.1. Problem Definition
2.2. Related Work
3. Overview of Our Algorithm
- Phase 1 (Construction of index structure). In this phase, we build a novel index structure called the temporal candidate graph based on the query graph and data graph. The TCG stores all necessary information required for enumerating matchings. The details about Phase 1 will be presented in Section 4.
- Phase 2 (Enumeration of matchings). In this phase, we first construct a query matching tree for generating a matching order. Then, we enumerate all matchings on the TCG by following the matching order. Details about Phase 2 will be presented in Section 5.
Algorithm 1: TMQ(, ) |
Input : A temporal query set and a data graph . |
Output : All matchings of in . |
|
4. Construction of Index Structure
4.1. Vertex State Determination
- 1.
- : A set of query vertices with the same label as v, i.e., .
- 2.
- : A label set of neighbors of vertices in , i.e., .
- 3.
- : A set of neighbors of v in that have a label in , i.e., .
- 4.
- : A time set recording the timestamps of the edge connecting v and each vertex in , i.e., .
- 5.
- : First, for each vertex , add an edge between w and its time set in if passes through the check; then, add an edge between w and its label if w is connected with a time set; then, for each vertex and its neighbors’ label , add an edge if L has at least τ neighbors in , where τ is the number of neighbors of u with label L in the query graph.
4.2. Index Construction
- 1.
- ;
- 2.
- For each , if "True", then add a directed edge into for each vertex if w has at least one edge in , where is the temporal neighborhood matching graph of v;
- 3.
- For , if there exists a bidirectional edge between v and w, then add into , where is a set of time subsets of that satisfy the temporal constraints.
Algorithm 2: BuildTCG(q, ) |
4.3. Algorithm Analysis
5. Enumeration of Matchings
5.1. Matching Order Generation
5.2. Matching Enumeration
Algorithm 3: SearchMatch(, ) |
6. Experiments
6.1. Experimental Setup
6.2. Processing Time
6.3. Memory Usage
6.4. Scalability
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Verizon. Data Breach Investigations Report 2020. Comput. Fraud. Secur. 2020, 4. [Google Scholar]
- Aly, A.; Iqbal, S.; Youssef, A.; Mansour, E. MEGR-APT: A Memory-Efficient APT Hunting System Based on Attack Representation Learning. IEEE Trans. Inf. Forensics Secur. 2024, 19, 5257–5271. [Google Scholar] [CrossRef]
- Choudhury, S.; Holder, L.; Chin, G.; Agarwal, K.; Feo, J. A Selectivity based approach to Continuous Pattern Detection in Streaming Graphs. arXiv 2015, arXiv:1503.00849. [Google Scholar]
- Jia, Y.; Gu, Z.; Du, L.; Long, Y.; Wang, Y.; Li, J.; Zhang, Y. Artificial intelligence enabled cyber security defense for smart cities: A novel attack detection framework based on the MDATA model. Knowl.-Based Syst. 2023, 276, 110781. [Google Scholar] [CrossRef]
- Milajerdi, S.M.; Rigel, G.; Birhanu, E.; Venkatakrishnan, V.N. POIROT: Aligning Attack Behavior with Kernel Audit Records for Cyber Threat Hunting. In Proceedings of the CCS′19: Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, London, UK, 11–15 November 2019. [Google Scholar]
- Satvat, K.; Gjomemo, R.; Venkatakrishnan, V. Extractor: Extracting Attack Behavior from Threat Reports. In Proceedings of the 2021 IEEE European Symposium on Security and Privacy (EuroS&P), Vienna, Austria, 6–10 September 2021. [Google Scholar]
- Wei, R.; Cai, L.; Zhao, L.; Yu, A.; Meng, D. DeepHunter: A Graph Neural Network Based Approach for Robust Cyber Threat Hunting. In Proceedings of the Security and Privacy in Communication Networks, Virtual Event, 6–9 September 2021. [Google Scholar]
- Peng, G.; Fei, S.; Xiaoyuan, L.; Xusheng, X.; Zheng, Q.; Fengyuan, X.; Prateek, M.; Kulkarni, S.R.; Dawn, S. Enabling Efficient Cyber Threat Hunting With Cyber Threat Intelligence. In Proceedings of the 2021 IEEE 37th International Conference on Data Engineering (ICDE), Chania, Greece, 19–22 April 2021. [Google Scholar]
- Ullmann, J.R. An Algorithm for Subgraph Isomorphism. J. ACM 1976, 13, 31–42. [Google Scholar] [CrossRef]
- Cordella, L.P.; Foggia, P.; Sansone, C.; Vento, M. A (sub)graph isomorphism algorithm for matching large graphs. IEEE Trans. Pattern Anal. Mach. Intell. 2004, 26, 1367–1372. [Google Scholar] [CrossRef] [PubMed]
- Shang, H.; Zhang, Y.; Lin, X.; Yu, J.X. Taming verification hardness: An efficient algorithm for testing subgraph isomorphism. Proc. VLDB Endow. 2008, 1, 364–375. [Google Scholar] [CrossRef]
- He, H.; Singh, A.K. Graphs-at-a-time: Query Language and Access Methods for Graph Databases. In Proceedings of the SIGMOD ’08: Proceedings of the 2008 ACM SIGMOD international conference on Management of Data, Vancouver, BC, Canada, 10–12 June 2008. [Google Scholar]
- Zhao, P.; Han, J. On graph query optimization in large networks. Proc. VLDB Endow. 2010, 3, 340–351. [Google Scholar] [CrossRef]
- Han, W.S.; Lee, J.; Lee, J.H. Turboiso: Towards ultrafast and robust subgraph isomorphism search in large graph databases. In Proceedings of the SIGMOD ’13: Proceedings of the 2013 ACM SIGMOD International Conference on Management of Data, New York, NY, USA, 22–27 June 2013. [Google Scholar]
- Ren, X.; Wang, J. Exploiting Vertex Relationships in Speeding up Subgraph Isomorphism over Large Graphs. Proc. VLDB Endow. 2015, 8, 617–628. [Google Scholar] [CrossRef]
- Bi, F.; Chang, L.; Lin, X.; Qin, L.; Zhang, W. Efficient Subgraph Matching by Postponing Cartesian Products. In Proceedings of the SIGMOD’16: Proceedings of the 2016 International Conference on Management of Data, San Francisco, CA, USA, 26 June–1 July 2016. [Google Scholar]
- Han, M.; Kim, H.; Gu, G.; Park, K.; Han, W.S. Efficient Subgraph Matching: Harmonizing Dynamic Programming, Adaptive Matching Order, and Failing Set Together. In Proceedings of the SIGMOD’19: Proceedings of the 2019 International Conference on Management of Data, Amsterdam, The Netherlands, 30 June–5 July 2019. [Google Scholar]
- Kim, H.; Choi, Y.; Park, K.; Lin, X.; Hong, S.H.; Han, W.S. Versatile Equivalences: Speeding up Subgraph Query Processing and Subgraph Matching. In Proceedings of the SIGMOD/PODS’21: Proceedings of the 2021 International Conference on Management of Data, Xi’an, China, 20–25 June 2021. [Google Scholar]
- Kim, H.; Choi, Y.; Park, K.; Lin, X.; Hong, S.H.; Han, W.S. Fast subgraph query processing and subgraph matching via static and dynamic equivalences. VLDB J. 2023, 32, 343–368. [Google Scholar] [CrossRef]
- Ansari, Z.A.; Parwez, M.A.; Thoker, I.R.; Jahiruddin. Enhanced Subgraph Matching for Large Graphs using Candidate Region-Based Decomposition and Ordering. J. King Saud Univ.-Comput. Inf. Sci. 2023, 35, 101694. [Google Scholar] [CrossRef]
- Jian, X.; Li, Z.; Chen, L. SUFF: Accelerating Subgraph Matching with Historical Data. Proc. VLDB Endow. 2023, 16, 1699–1711. [Google Scholar] [CrossRef]
- Amine, M.; Chathura, K.; Semih, S. Optimizing One-time and Continuous Subgraph Queries using Worst-case Optimal Joins. ACM Trans. Database Syst. 2021, 46, 1–45. [Google Scholar]
- Zervakis, L.; Setty, V.; Tryfonopoulos, C.; Hose, K. Efficient Continuous Multi-Query Processing over Graph Streams. arXiv 2019, arXiv:1902.05134. [Google Scholar]
- Xi, W.; Qianzhen, Z.; Deke, G.; Xiang, Z. Continuous multi-query optimization for subgraph matching over dynamic graphs. Semant. Web 2022, 13, 601–622. [Google Scholar]
- Ziyi, M.; Jianye, Y.; Xu, Z.; Guoqing, X.; Jianhua, W.; Liang, Y.; Kenli, L.; Xuemin, L. Efficient Multi-Query Oriented Continuous Subgraph Matching. In Proceedings of the 40th IEEE International Conference on Data Engineering, ICDE 2024, Utrecht, The Netherlands, 13–16 May 2024. [Google Scholar]
- Li, F.; Zou, Z.; Li, J.; Yang, X.; Wang, B. Evolving subgraph matching on temporal graphs. Knowl.-Based Syst. 2022, 258, 109961. [Google Scholar] [CrossRef]
- Sun, S.; Luo, Q. Subgraph Matching With Effective Matching Order and Indexing. IEEE Trans. Knowl. Data Eng. 2022, 34, 491–505. [Google Scholar] [CrossRef]
Dataset | Vertices | Temporal Edges | Static Edges | Time Span |
---|---|---|---|---|
CollegeMsg (college) | 1899 | 59,835 | 20,296 | 193 days |
MathOverflow (math) | 21,688 | 107,581 | 90,489 | 2350 days |
SuperUser (super) | 194,085 | 1,443,339 | 924,886 | 2773 days |
WikiTalk (wiki) | 1,140,149 | 7,833,140 | 3,309,592 | 2320 days |
StackOverflow (stack) | 2,464,606 | 17,823,525 | 16,266,395 | 2774 days |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Lu, M.; Zhang, Q.; Zhu, X. Temporal Multi-Query Subgraph Matching in Cybersecurity. Technologies 2025, 13, 335. https://doi.org/10.3390/technologies13080335
Lu M, Zhang Q, Zhu X. Temporal Multi-Query Subgraph Matching in Cybersecurity. Technologies. 2025; 13(8):335. https://doi.org/10.3390/technologies13080335
Chicago/Turabian StyleLu, Min, Qianzhen Zhang, and Xianqiang Zhu. 2025. "Temporal Multi-Query Subgraph Matching in Cybersecurity" Technologies 13, no. 8: 335. https://doi.org/10.3390/technologies13080335
APA StyleLu, M., Zhang, Q., & Zhu, X. (2025). Temporal Multi-Query Subgraph Matching in Cybersecurity. Technologies, 13(8), 335. https://doi.org/10.3390/technologies13080335