Detecting Complex Multi-step Attacks with Explainable Graph Neural Network

Wei Liu, Peng Gao, Haotian Zhang, Ke Li, Weiyong Yang, Xingshen Wei, Shuji Wu · DOI

Abstract

Complex multi-step attacks have caused significant damage to numerous critical infrastructures. To detect such attacks, graph neural network based methods have shown promising results by modeling the system's events as a graph. However, existing methods still face several challenges when deployed in practice. First, there is a lack of sufficient real attack data especially considering the large volume of normal data. Second, the modeling of event graphs is challenging due to their dynamic and heterogeneous nature. Third, the lack of explanation in learning models undermines the trustworthiness of such methods in production environments. To address the above challenges, in this paper, we propose an attack detection method, Trace2Vec. The approach first designs an erosion function to augment rare attack samples, and integrates them into the event graphs. Next, it models the event graphs via a continuous-time dynamic heterogeneous graph neural network. Finally, it employs the Monte Carlo tree search algorithm to identify events with greater contributions to the attack, thus enhancing the explainability of the detection result. We have implemented a prototype for Trace2Vec, and the experimental evaluations demonstrate its superior detection and explanation performance compared to existing methods.

Introduction: The Challenge of Complex Multi-step Attacks

Complex Multi-step Attacks (CMAs), such as the WannaCry ransomware, involve a series of subtle, interconnected actions—logins, file movements, and network calls—that can span days or weeks. Detecting these is akin to finding a needle in a haystack. Current Graph Neural Network (GNN) detection methods struggle with three major hurdles:

  1. Data Imbalance: In real-world environments, 99.9% of system logs are "normal." Learning-based models struggle to recognize attacks because they rarely see them during training.
  2. Temporal Complexity: Attacks are dynamic and heterogeneous. A "file read" at 9:00 AM might be benign, but when linked to a "remote login" at 9:05 AM, it becomes suspicious. Capturing these long-term dependencies is computationally difficult.
  3. The Black Box Problem: Even if a GNN flags an event as malicious, it rarely explains why. In critical infrastructure, security teams require forensic evidence to act on an alert.

Methodology: The TRACE2VEC Framework

To address these limitations, the authors introduce TRACE2VEC, a framework that operates in three distinct phases: sample augmentation, dynamic detection, and explainable forensics.

Figure 1: The overall architecture of TRACE2VEC, illustrating the data augmentation, the CDHGN detector, and the MCTS-based explainer.

1. Negative Sample Generation (The Erosion Function)

To solve data scarcity, TRACE2VEC uses Cyber Threat Intelligence (CTI) reports to create "strong negative samples." It applies an "erosion function" to normal system graphs—perturbing nodes and edges based on known attack patterns—to simulate realistic malicious behavior for the model to learn from.

2. The Detector (CDHGN)

The core of the system is a Continuous-time Dynamic Heterogeneous Graph Neural Network (CDHGN). It utilizes a memory mechanism and attention layers to capture long-term dependencies in system logs. It treats the infrastructure as an evolving graph where nodes (users, files, IPs) and edges (actions) change over time, allowing the model to detect anomalies in the context of historical behavior.

3. The Explainer (Sniffer-Excavator)

This is the framework's most novel contribution to explainability.

  • The Sniffer: A Multilayer Perceptron that computes relevance scores for events.
  • The Excavator: Uses Monte Carlo Tree Search (MCTS) to navigate the massive system graph and identify the specific subgraph (the "explanation") that contributed most to the anomaly score. Unlike previous explainers that work on static graphs, this handles the temporal "flow" of an attack.

Experimental Evaluation

The framework was evaluated on two major benchmarks: CERT (V6.2), which simulates insider threats, and ATLAS (M2 and M5), which contains real-world Advanced Persistent Threat (APT) data.

Figure 4: Performance comparison on the ATLAS dataset (M2 and M5 scenarios) showing TRACE2VEC's superior AUC across different training splits.

Key Results

  • Superior Accuracy: TRACE2VEC improved detection accuracy (AUC) by up to 13.0% compared to state-of-the-art baselines like Log2vec and TGNN. As shown in the ATLAS results, it consistently maintains high performance even with limited training data.
  • Better Explanations: The model improved "Fidelity" (a measure of how accurately the explanation reflects the model's logic) by up to 20.1%.
  • Robustness to Imbalance: Even when malicious samples were extremely rare, the model maintained an AUC of 0.97 on the CERT dataset.
  • Forensic Success: In case studies, TRACE2VEC successfully identified all anomalous behaviors, whereas competitors missed key steps because they could not maintain enough temporal context over long durations.

Insights and Future Directions

TRACE2VEC demonstrates that CTI-driven augmentation is essential for training robust security models. By using actual threat intelligence to guide graph modifications, the model learns the semantics of an attack rather than just statistical noise. Furthermore, the use of MCTS for forensics mimics human investigation patterns, allowing the system to prune irrelevant events and provide actionable insights.

While highly effective, the current explainer is "post-hoc." Future work aims to explore intrinsic explainability, where the model is designed to be readable by default, and to reduce the computational overhead of searching massive enterprise-scale graphs in real-time.

Summary updated

BibTeX
@misc{liu2024detecting,
  author = {Wei Liu and Peng Gao and Haotian Zhang and Ke Li and Weiyong Yang and Xingshen Wei and Shuji Wu},
  title = {{Detecting Complex Multi-step Attacks with Explainable Graph Neural Network}},
  year = {2024},
  eprint = {2405.11335},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.11335},
}
Figure